how to compare two files

Microsoft Windows xp home edition with s...
April 29, 2010 at 06:47:48
Specs: Windows XP
How can i compare data in one file with the data in another file and i should get the result as the lines that are not there in the second file

ex:my first file contains data
1.one
2.two
3.three
4.four

the second file contains data
1.one
3.three

now after comparision of two files i should get the result as
2.two
4.four
can anyone knows how to do it in windows using a batch file


See More: how to compare two files

Report •

#1
April 29, 2010 at 08:54:46
@echo off > newfile & setLocal enableDELAYedeXpansion

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


=====================================
Helping others achieve escape felicity

M2


Report •
Related Solutions


Ask Question