I want to search for a particular string in a text file.
I was trying to open the file for read and use a while loop to search for the string line by line. I want to stop at the first match but I dont know how to exit from the while loop after the match.
could anybody help?
any other solutions are also welcome.
thnks
-bcd
I was trying to open the file for read and use a while loop to search for the string line by line. I want to stop at the first match but I dont know how to exit from the while loop after the match.
could anybody help?
any other solutions are also welcome.
thnks
-bcd