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
disable edit , new record links
Registry key property value
return a value
call .rdl with store procedure with parameter
NTDS Settings
unknown process - should I be concerned
Exchange 2003 - Language Issue
Mac Mail only shows 90 days of deleted items
What is the best tool to repair corrupted jpeg files missing its header?
Column Name in query