I’m trying to figure out how to find a certain string and display how many lines down it is in a text file.
For example let’s saying I’m trying to find the string “I’m a string” in a text file then also have the location of the string(As in lines down) recorded in a variable.
Anyone got any tips too accomplish this?
Thanks
First, I would read in the file, then loop through each line searching for the text. Something like…