My first guess, which turns out to be confirmed, is that the files use different line endings. It could be some other difference in whitespace, such as the presence of trailing whitespace (but you typically wouldn't get that on many lines) or different indentation (tabs vs spaces). Use a command that prints out whitespace and control characters in a visible form, such as
diff <(cat -A file1) <(cat -A file2)
diff <(sed -n l file1) <(sed -n l file2)
You can confirm that the differences only have to do with line endings by normalizing them first. You may have a dos2unix utility; if not, remove the extra CR (^M, \r, \015) character explicitly:
diff <(tr -d '\r' <file1) <(tr -d '\r' <file2)
or, if file1 is the one with DOS endings
tr -d '\r' <file1 | diff - file2
sed -n l filename. If it won't help, add a data example anddiffoutput here. – rush Aug 17 '12 at 13:18