Need a Batch file to search a string

August 24, 2010 at 04:04:35
Specs: Windows XP
Hi, I have to text files A and B. I would like to read file A line by line and check that the string is exist in file B, non existence string to be copied in a new file C. Very helpful to me if anyone provide me the batch script.

File A File B
Paul Jack
Joe Jim
Lisa Joe
Tom Paul
Jim Dave
(Tom and Lisa would be copied in file C in order)

Thanks in advance.
~John


See More: Need a Batch file to search a string

Report •


#1
August 24, 2010 at 05:30:54
ownload gawk for windows then do this

c:\test> gawk.exe "FNR==NR{a[$1];next}(! ($1 in a) )" file2 file1
Lisa
Tom

GNU win32 packages | Gawk


Report •

#2
August 24, 2010 at 06:21:18
Thanks ghostdog, but I cannot install gawk in office system. I think, DOS batch script is ideal solution. Kindly provide the DOS batch script.

Report •

#3
August 24, 2010 at 06:51:51
you can download from anywhere, store it on your thumb drive and bring to work. Its just one exe file. And no, i will not provide you the batch script. you can wait for someone else to do your work for you.

GNU win32 packages | Gawk


Report •
Related Solutions


Ask Question