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

1 ビュー (過去 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
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
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
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