locked
Read Text file and count occurences of certain string RRS feed

  • Question

  • Hello,

    I have a text file with lines of data in it. I would like to read this text file and count how many lines match a certain string of text. 

    For example my text file has this data in it.

    dog,blue,big

    dog,red,small

    dog,blue,big

    cat,blue,big

    If the certain string of text is "dog,blue,big" then the count would return "2".

    Thanks for your help

    • Moved by Amanda Zhu Thursday, July 3, 2014 7:21 AM
    Tuesday, July 1, 2014 12:42 PM

Answers