Diff command problem

Folks,
I am Diff'ing 2 identical files..and the result is, it shows all the lines from 2 files (saying nothing is being matched).

If I copy the content from 1 of the file and paste in a newly created file and then do the diff, it equals.

2 files are xml files.
I've tried many combinations..no clue till now.

I have 1 file as base file and another one comes from a Java Process and on which I do some parsing and substitution of Strings.

Please through some light on this ..

--Venkat.

Get an md5 checksum of each file. That will tell you if they are different.

Thanks Portor.

Yes, I see different "cksum" for 2 files. but still I am not understanding why they r differing though the content is same?

Any more clues?

Far too much of a guessing game. Try doing a od command on each of the files, say for the first couple of lines of input.

Most likely, a tab will be spaces, or one file will end in a DOS format, and not Unix.

The od command will show you the actual characters in each of the files (not just how they show on a screen), so you shold be able to decipher from there.

Try a

cat -vet <filename>

on each file and as awk said look for tabs that have been converted to spaces or ^M chararcters at the end of the lines.