DOS command to compare two files

Microsoft Running ms-dos 20th anniversar...
February 25, 2010 at 23:21:35
Specs: Windows XP
All,

I need to compare the contents of two files in WINDOWS environment and write
the difference in another flat file.

e.g ,
a.txt contains 01,02,10,11 &
b.txt contains 05,01,02,03,10,11

I need to generate a file c.txt that will contain 05,03.

I know, DOS command 'fc' does the comparison but the output is in a
different format.

Any suggestions is greatly appreciated.

Thanks in advance !


See More: DOS command to compare two files

Report •


#1
February 26, 2010 at 01:55:02
So the two files have only one line each, right?

And the criteria is what? Show data elements which are in b but not in a?


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

M2


Report •

#2
February 26, 2010 at 02:16:58
its just an example which i showed above, files may contain many lines also

when i campare two files, it has to generate a new file which should contain only differences between the two files, similarities should not come

i just want a new file which should contain only differences between the first two files


Report •

#3
February 26, 2010 at 14:29:55
You would have to use the comma's to then make tables or arrays. Then take the tables/arrays and compare.

No line diff program can do what your example calls for, they are too basic.

Playing to the angels
Les Paul (1915-2009)


Report •

Related Solutions

#4
February 28, 2010 at 22:18:55
Actually i want a script to compare two files content,

per suppose, if i give command like this

fc a.txt b.txt > log.txt

first requirement is

it has to give only differences which are present in the latest updated file (May be say b.txt)

second one is

what are the new things which were inserted newly in latest updated file

Third one is

what are the things which were removed in latest updated file

For all these things it has 2 generate log files separately

pls help me in doing this


Report •


Ask Question