MATLAB Answers

What does this mean "No differences to display. The files are not identical, but the only differences are in end-of-line characters."

3 views (last 30 days)
Kazi Alam
Kazi Alam on 16 Jul 2021
Edited: Stephen on 16 Jul 2021
Hallo, Thank you for reading.
After comparing the two files I have received feedback from MATLAB which states
"No differences to display. The files are not identical, but the only differences are in end-of-line characters."
Can anyone help me to understand the meaning?
Note that: Even though both files looks similar but these function differently when I try to use these with another software.
For your information, both files are attached here.
  2 Comments
Stephen
Stephen on 16 Jul 2021
"As the two files do not have exactly the same size , there must be a diffeence somewhere , but this may require to do an extensive test line by line , character by character"
Why bother? MATLAB has already told us what the exact difference is.
"my text editor tool gives me this result ...The files are identical"
Your unnamed text editor is set to ignore EOL differences. All reputable text comparison tools allow this setting to be changed.

Sign in to comment.

Accepted Answer

Stephen
Stephen on 16 Jul 2021
Edited: Stephen on 16 Jul 2021
"Can anyone help me to understand the meaning? "
When you look at those files then they are shown with lots of lines. You might even think that text files are saved somehow in "lines". But all text files are in fact just saved as one long vector of characters. Within that long vector of characters the "end of line" (aka EOL) characters are special characters** which tell your text editor that "this is the end of the line, please start a new line".
But different operating systems use different EOL character/s:
The files you uploaded contains exactly the same printing characters, but use different EOL characters.
So in most text editors they will look the same, unless you turn on the feature to show all characters:
We can clearly see in the above screenshots the EOL characters:
  • zone - Kopie.txt uses only LF (linefeed), used by Linux, macOS, etc.
  • zone__ - Kopie.txt uses both CR and LF (carriage return and linefeed), used by Windows, OS/2, etc.
But... badly written applications which assume particular EOL characters might fail to work with one/both of those files. If the application requires particular EOL characters, then you will have to change the file/s to suit that application. Any reliable text editor offers this feature, e.g.:
Edit -> EOL Conversion
** The EOL characters are also non-printing characters (i.e. you cannot see them), but otherwise they are just perfectly normal characters. By the way, there are also many other non-printing characters or control characters:

More Answers (1)

Jonas
Jonas on 16 Jul 2021
Edited: Jonas on 16 Jul 2021
it's about on how the new line is stored. there are differences between different operating systems (OS). you can read more about that here for example

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!