Forum Discussion

Adam1's avatar
Occasional Contributor
5 years ago

Compare windows and unix files, ignore line endings



My testing application is exporting some files in windows and other files in unix format. I want to compare those files with reference files using the method. But every time the test gives error saying the files are not equal. They are equal, except the format, windows/unix, the line endings are different. And when I try to save the reference files in other format, our version system doesn't keep that change. 


Is there a way to compare windows files with unix files, ignoring the line endings?



  • Already found out how to do it. It's a bit ugly to replace the file line by line and then compare the replaced file with the reference file, but if it works..

3 Replies