Unmatch between two text files

February 26, 2011 at 02:26:14
Specs: Windows XP, 2GB
Thanks in Advance..

I have two files file1 and file2 and both have data. I want to serach one file string into another file and print those record not found in file2.

I want to do the same by dos batch.

If anyone help me this will be great support to me.

Example--
File1
ram
sam

File2
ram
tom
min

Output-
sam


See More: Unmatch between two text files

Report •


#1
February 26, 2011 at 04:50:03
:: ==========================================
::
:: motiur.bat Sat 26-02-2011 19:47:34.34
@echo off & setLocal enableDELAYedeXpansion

for /f "tokens=* delims= " %%a in (file1) do (
find "%%a" < file2 > nul
if errorlevel 1 echo.%%a
)


=====================================
Life is too important to be taken seriously.

M2


Report •

#2
March 1, 2011 at 01:49:02
Hi Thank you very much for your suuport..

but there is slight change in requirement. Is there way to do for below example.
File1
ram
sam
tom

File2
ram
tom
min
rams
tomey

Output-
Sam

In this if file1 string matches with any beginig of file2 string then this will not be mismatch..

Once thanks for your such help..


Report •

#3
March 1, 2011 at 02:36:33
Not clear. Try again.


=====================================
Life is too important to be taken seriously.

M2


Report •

Related Solutions

#4
March 1, 2011 at 03:16:19
Thnaks..i done this..

Report •


Ask Question