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

6 次查看(过去 30 天)
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 个评论
Mathieu NOE
Mathieu NOE 2021-7-16
hello
my text editor tool gives me this result, even though bye eye I could not see any difference
Compare: (<)C:\Users\A0H36019\Documents\zone - Kopie.txt (4632 bytes)
with: (>)C:\Users\A0H36019\Documents\zone__ - Kopie.txt (4763 bytes)
The files are identical
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
Stephen23
Stephen23 2021-7-16
编辑:Stephen23 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.

请先登录,再进行评论。

采纳的回答

Stephen23
Stephen23 2021-7-16
编辑:Stephen23 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

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by