RATE THIS ANSWER
0
Click to Vote:
0
0
From a Windows command script you can do several things to parse text. The most complicated is to use a FOR loop to parse it one line at a time, use a sub routine for parsing and ECHO the result back out to a new file.
The simplest solution is to use FINDSTR with the "/v" option which prints out lines that do not match and redirect to a new file.
If you have a large number of criteria to test against, I suggest using a FINDSTR for each criteria or use the "/G" option to feed a file with the search criteria.
There are several methods of specifying the search criteria.
Example of basic findstr command using the "/C" search string option:
findstr /v /i /c:"My criteria" "C:\temp\test.txt">"C:\temp\test2.txt"
Tools that can be used as a filter or editing tool:
FINDSTR, FIND, SED, GREP, AWK
For SED, the SSED port as Windows 32-bit application is a great tool
I don't have a specific AWK windows port to recommend
The Microsoft port of GREP works well (resource kit tool)
Personally, I prefer FINDSTR to FIND for manipulating text files.
Last Answered:
Jun 25 2009 6:36 PM GMT by Pjb0222 
1095 pts.