Microsoft
Software
Hardware
Network
Question : Loop searching a text file for specific strings
I have a text file with 3,682 file names, one filename per line - call it "GUIDS.txt"
I have a log file called "combined_log.txt"
I want to search combined_log.txt to see if any of the 3,682 file names appear in this log text file
If any line item in GUIDS.txt is found in combined_log.txt, I want to output it to: "findings.txt"
I created a batch file called GUIDS.bat
ECHO OFF
REM GUIDs.bat
FOR /F %%i IN (c:\TEMP\GUISD.TXT) do FIND %%i C:\temp\combined_log.txt
I then ran the batch file as:
GUIDS.bat >> findings.txt
However, I get an error:
FIND: Parameter format incorrect.
I am working in Windows XP and this seems like a simple loop script.
Does anyone have a solution that works?? I don't want to do an individual "FIND" command for each of the 3,682 filenames!!!
Thanks!
Answer : Loop searching a text file for specific strings
put your find string in double quotation.
try this.
ECHO OFF
REM GUIDs.bat
FOR /F %%i IN (c:\TEMP\GUISD.TXT) do FIND "%%i" C:\temp\combined_log.txt
hope this will solve your problem.
Random Solutions
How to hide a dummy date value.
unload view when switching tab
Batch printing word document to non-default printer
Create a distribution list based on a security group
How many squares are in this diagram?
Memory leak in my exchnage server
object required error
pinging devices on ipsec tunnel
How to simultaneously send and recv data from a single socket?
Access 2010 option button value