Comparing LF, CR+LF and \t and spaces (on a different places) in two text files

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
angel
Junior Member
Junior Member
Posts: 46
Joined: 2014-10-17, 06:54 UTC
Location: Sofia, Bulgaria, Europe

Comparing LF, CR+LF and \t and spaces (on a different places) in two text files

Post by *angel »

When comparing two the same text files in Unix (LF) and in Windows (CR+LF) file format also may or may not contain "\t" or spaces on a different places, the result in "Compare contents" window shows "0 differences found".
This can be interpreted as a philosophical question: are these two text files equal or not?

Мerry welcome to the holidays
#381167 Single user license [08:50, 26.10.2022]
User avatar
angel
Junior Member
Junior Member
Posts: 46
Joined: 2014-10-17, 06:54 UTC
Location: Sofia, Bulgaria, Europe

Re: Comparing LF, CR+LF and \t and spaces (on a different places) in two text files

Post by *angel »

Create two text files with the same content like "123456789". In second file insert some spaces (or tabs) in front of the content "123456789" (something like that: " 123456789")
When compare these two files in "Compare contents" window will shows "0 differences found", but actually there is a difference!
#381167 Single user license [08:50, 26.10.2022]
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Comparing LF, CR+LF and \t and spaces (on a different places) in two text files

Post by *Horst.Epp »

Thats wrong.
You have set the option "Ignore repeated spaces".
Remove this option and TC reports 1 difference.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
angel
Junior Member
Junior Member
Posts: 46
Joined: 2014-10-17, 06:54 UTC
Location: Sofia, Bulgaria, Europe

Re: Comparing LF, CR+LF and \t and spaces (on a different places) in two text files

Post by *angel »

Horst.Epp wrote: 2021-12-25, 09:49 UTC Thats wrong.
You have set the option "Ignore repeated spaces".
Remove this option and TC reports 1 difference.
Horst.Epp you are right about spaces and tabs. I even didn't saw the option "Ignore repeated spaces". Thank you!
But you are wrong about "LF"(unix) comparing with "CR+LF"(windows):
["123456789"LF <=!=> "123456789"CR+LF]
{PS. Please, don't be mad ат me, I am trying to be just а TC improver}

Best Regards
#381167 Single user license [08:50, 26.10.2022]
User avatar
Dalai
Power Member
Power Member
Posts: 9366
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Comparing LF, CR+LF and \t and spaces (on a different places) in two text files

Post by *Dalai »

angel wrote: 2021-12-24, 15:04 UTCThis can be interpreted as a philosophical question: are these two text files equal or not?
The lines themselves are equal, but the line endings might not be identical. The question is: How do you indicate a difference in line endings without it appearing that all lines are different? Line endings are not printable as a character.

If the files are identical, i.e. exact same byte sequence throughout both files, TC just informs the user about that and doesn't open the Compare by contents window. Considering the fact that TC opens the Compare by contents window indicates that there are some differences which might be caused by non-printable characters. The number in the lower left corner tells the user about the number of differences on the lines themselves; this number is also influenced by the other options like ignoring repeated spaces, as you have experiences yourself.

AFAIK TC has always behaved this way, and I wouldn't want to see it changed now after so many years.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
angel
Junior Member
Junior Member
Posts: 46
Joined: 2014-10-17, 06:54 UTC
Location: Sofia, Bulgaria, Europe

Re: Comparing LF, CR+LF and \t and spaces (on a different places) in two text files

Post by *angel »

Dalai wrote: 2021-12-25, 10:21 UTC AFAIK TC has always behaved this way, and I wouldn't want to see it changed now after so many years.
Nobody likes the change, especially the old one :)
[thanks God, the Nature thinks different :)]

Best Regards
#381167 Single user license [08:50, 26.10.2022]
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Comparing LF, CR+LF and \t and spaces (on a different places) in two text files

Post by *Hacker »

Moderator message from: "Hacker"

Moved to the English forum.
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Post Reply