unfateful
10-11-2008, 02:39 AM
Hi everyone, newcomer here. The project I'm working on is a text file parser. I'm trying to have it remove a line of text if a certain pattern isn't found on the line.
Example:
myText.txt file has
10/10/2008 - The quick brown fox jumped over the moon.
10/10/2008 - The quick brown fox jumped over the sun.
I want to do a search of each line of the text file and delete the line if it didn't have the required pattern, like "moon", the second line will be deleted since it doesn't contain the string "moon" in it.
Example:
myText.txt file has
10/10/2008 - The quick brown fox jumped over the moon.
10/10/2008 - The quick brown fox jumped over the sun.
I want to do a search of each line of the text file and delete the line if it didn't have the required pattern, like "moon", the second line will be deleted since it doesn't contain the string "moon" in it.