Compare two different text files+batch

September 30, 2009 at 04:49:46
Specs: Windows XP, -

I need to write batch script which will compare text string "AAA8888,131676,2000-09-23 00:00:00.0,2009-09-23 07:01:45.0 " from 1.txt with
text string like "Critical 09/22/2000 01:28:12 AAA8888_XXXXX Some text " .
Fields to be compared are in BOLD.
I'm doing this by : "for /F " eol=N tokens=4* delims=_ " %%i in (2.txt) DO FIND "%%i" 1.txt

If the string wasn't found do some action.
How can I do this?
Thanks in advance!

See More: Compare two different text files+batch

Report •

October 9, 2009 at 02:58:37
Think you should use "findstr" :)

for /f "tokens=4 delims=_" %%M in ('DIR /b /A-D "Somefile*"') do (
findstr /B /L "String to find" "%%M"||ECHO Move the file or copy to somwhere???
Then nest it with a new for loop to check the other file

Now the /B Match a pattern at the beginning /E match at the end
and The /Uses search string literally..

Hope this helps if not.. make M2 or someone else answer :P

Report •
Related Solutions

Ask Question