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."

조회 수: 2(최근 30일)
Kazi Alam
Kazi Alam 2021년 7월 16일
편집: Stephen 2021년 7월 16일
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
Stephen 2021년 7월 16일
"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.

댓글을 달려면 로그인하십시오.

채택된 답변

Stephen 2021년 7월 16일
편집: Stephen 2021년 7월 16일
"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:

추가 답변(1개)

Jonas 2021년 7월 16일
편집: Jonas 2021년 7월 16일
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



Community Treasure Hunt

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

Start Hunting!

Translated by