Compare by Contents finds 0 differences

English support forum

Moderators: Stefan2, Hacker, petermad

Post Reply
alphonse68
Junior Member
Junior Member
Posts: 39
Joined: 2011-09-26, 13:53 UTC

Compare by Contents finds 0 differences

Post by *alphonse68 »

Hello.
I noticed that when comparing two text files (*.bas exported from Excel VBA), the Compare Contents tool will open files that have 0 differences in the comparison window. This behaviour had happened very infrequently, such that I always supposed there must have been something to do with one of the files. However, in 11.57aRC1, I just compared 22 pairs of these exported files and 10 0-difference comparisons were opened. That does not rule out something in the files, therefore, my questions: Has this happened to anyone else? Does anyone one know of a reason for this?
Cheers
User avatar
Gral
Power Member
Power Member
Posts: 1785
Joined: 2005-01-26, 15:12 UTC

Re: Compare by Contents finds 0 differences

Post by *Gral »

This is a common behaviour if you e.g. compare files with difference in letters case or whitespaces only and proper option for comparison checked/unchecked. Use binary comparison for check your case.
User avatar
Dalai
Power Member
Power Member
Posts: 10312
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Compare by Contents finds 0 differences

Post by *Dalai »

There can also be differences in line-breaks, i.e. CRLF vs. LF. Binary comparison will help in this case, too.
#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
beb
Power Member
Power Member
Posts: 762
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Compare by Contents finds 0 differences

Post by *beb »

And in encodings, e.g., ANSI and UTF-16 LE files may have absolutely identical human-readable contents, while their underlying byte structures share almost nothing in common...
#278521 User License
Total Commander [always the latest version, including beta] x86/x64 on Win10 x64/Windows 11/Android 17
alphonse68
Junior Member
Junior Member
Posts: 39
Joined: 2011-09-26, 13:53 UTC

Re: Compare by Contents finds 0 differences

Post by *alphonse68 »

OK. Thank you all for your input.
I had no idea letter case would trigger but not show when different.
I shall keep in mind to do binary compare.
This time it was letter case, but I also learned to also be mindful of possible CRs, LFs, and encoding. :) :D
Once again, thank you to all three.
Cheers!!
User avatar
Dalai
Power Member
Power Member
Posts: 10312
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Compare by Contents finds 0 differences

Post by *Dalai »

Well, compare by content can be case-sensitive if the option "Case sensitive" is checked.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
BartS
Junior Member
Junior Member
Posts: 2
Joined: 2026-06-04, 09:14 UTC

Re: Compare by Contents finds 0 differences

Post by *BartS »

I think something is NOT right.

When comparing dirs using green arrow icon it correctly identifies files with SAME names (however different size - clearly different content).
So I switch to red unequal icon - zero results. So swithced to Red unequal icon with checked content - zero results (clearly wrong as there are files earlier identified as having same name but with different sizes which clearly indicates different content).

I do not think this is correct neither expected behaviour.
BartS
Junior Member
Junior Member
Posts: 2
Joined: 2026-06-04, 09:14 UTC

Re: Compare by Contents finds 0 differences

Post by *BartS »

So I thought it over again...
The unequal icon check apparently for different naming, so it won't show these files with the same name but different content.
I probably should use green arrow (filter same names first) with combination of comparing content to filter out only files with... different content. But it doesn't work. I have not found any filter combination for this scenario (find files with same names but different content).
User avatar
petermad
Power Member
Power Member
Posts: 17375
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Compare by Contents finds 0 differences

Post by *petermad »

2BartS
This topic is about "Compare by Content" NOT about "Synchronize directories"

Apart from that "Synchronize directories" always ONLY compare files with the same name. If they have the same size they are considered equal if the date is also the same unless you check "by content". . If the date is different but the content the same it will be marked either with green arrow or blue arrow - green if the file on the left side is newer, blue if the file on the right side is newer. If two files have the same content but different date and "ignore date" is checked, then the files are marked as equal.
License #524 1994
Danish TC Translator
TC 11.58 32+64bit on Windows XP 32bit & Windows 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1416b
TC 3.62 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply