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
Need to get the ip subset of a city
Installing BES on SBS 2008
Refining xi:include element to exclude data when a specific child tag's text is present.
HiJackThis Analysis. Also "NoIE4StubProcessing"
Moving WordPress Site - Page Not Found
Remove underscore from folder names and replace with space
TSQL nested WHILE EXISTS
SQLCommandBuilder - GetUpdateCommand, GetInsertCommand and GetDeleteCommand Questions
SCCM OSD deployment to Hyper-v R2
Raid 1 mirror Bad block discovered