read line of text and create new text file

Microsoft Windows xp professional w/serv...
July 8, 2010 at 14:15:51
Specs: Windows XP
I have several text files that look like this:


I would like to find a way for a batch file to read all the lines in a text file. When it comes across a "prin31" in each of the text files, create a new text file called prin31.txt (or if its already created, it will just add an extra line) and put the filenames into prin31.txt

Hope this makes sense. Thanks!

See More: read line of text and create new text file

Report •

July 9, 2010 at 08:46:16
findstr /i /m "prin31" *.txt>> prin31.txt

Report •

July 12, 2010 at 12:55:28
Thanks for the response.
My final script looks like this:

findstr /s /m /i prin31 *.* >> prin31.txt

txt files that came from registry had to be exported in ANSI format for findstr to work. By default registry exports in unicode format

Report •

Related Solutions

Ask Question