Wrong compare?
Moderators: Hacker, petermad, Stefan2, white
Wrong compare?
Hi,
I have compared 2 text files.
TC founds differences in the line, but in the same line it shows also another "difference", wich is wrong (-20,258.38 is in the same position in both files, why is marked with red? The same with -1,100.00 text)
Screenshot:
http://img151.imageshack.us/img151/8647/wrongcompare9jk.jpg
And one feature I wrote about in another thread:
would be VERY usefull to have an option to save the differences to a specific file with options set by a checkboxes:
1. Include or not line numbers.
2. Include or not lines from source file
3. Include or not lines from destination files.
In case when 2 & 3 are on: first line is the source line, second line is destination line, 3rd - source, 4th - destination, etc.
In case that only one of 2 or 3 is on: save just the lines with the differences from the respective file only.
Usefull when compare text files.
Regards.
I have compared 2 text files.
TC founds differences in the line, but in the same line it shows also another "difference", wich is wrong (-20,258.38 is in the same position in both files, why is marked with red? The same with -1,100.00 text)
Screenshot:
http://img151.imageshack.us/img151/8647/wrongcompare9jk.jpg
And one feature I wrote about in another thread:
would be VERY usefull to have an option to save the differences to a specific file with options set by a checkboxes:
1. Include or not line numbers.
2. Include or not lines from source file
3. Include or not lines from destination files.
In case when 2 & 3 are on: first line is the source line, second line is destination line, 3rd - source, 4th - destination, etc.
In case that only one of 2 or 3 is on: save just the lines with the differences from the respective file only.
Usefull when compare text files.
Regards.
- sqa_wizard
- Power Member
- Posts: 3893
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
- sqa_wizard
- Power Member
- Posts: 3893
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
- ghisler(Author)
- Site Admin
- Posts: 50475
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Unfortunately the compare text function is far from prefect. I did my best when I developped it (and I didn't steal any other people's code), but I simply cannot catch all possible situations. When a mismatch is found, TC tries to re-sync the two lines by searching for characters which match again.
In your special case I cannot say where the problem is without having the files.
In your special case I cannot say where the problem is without having the files.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Hi Author of Total Commander, great job 
The files are very simple. You can create by yourself:
File 1.txt
123(11)----------456----------789
File 2.txt
123/111(11)------456----------789
When I compare these lines:
1. "456" is highlighted.
But as You said, You are looking for characters which match again, and they do (as "(11)" text, which is not highlighted as difference and it's ok).
And "Ignore repeated spaces" checkbox does not help. Isn't it for these situations? 'cause we have different number of spaces in front of same "456" text.
2. the 4 "spaces" in front of 789 are highlighted... why ?
Screenshot:
Image: http://img184.imageshack.us/img184/9018/wrongcompare2yf4.jpg

The files are very simple. You can create by yourself:
File 1.txt
123(11)----------456----------789
File 2.txt
123/111(11)------456----------789
When I compare these lines:
1. "456" is highlighted.
But as You said, You are looking for characters which match again, and they do (as "(11)" text, which is not highlighted as difference and it's ok).
And "Ignore repeated spaces" checkbox does not help. Isn't it for these situations? 'cause we have different number of spaces in front of same "456" text.
2. the 4 "spaces" in front of 789 are highlighted... why ?
Screenshot:
Image: http://img184.imageshack.us/img184/9018/wrongcompare2yf4.jpg
- ghisler(Author)
- Site Admin
- Posts: 50475
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
OK, what happens here is the following:
1. TC finds the match "123"
2. It finds mismatch "(" and "/"
3. It finds again a match "(11)------", so "/111" is seen as
inserted text
4. It finds mismatch "-" and "4"
5. It finds again match "---", so "456" is seen as inserted text
6. It finds mismatch "4" and "-"
7. It finds again match "-----", so "456" in the other panel is seen as mismatch
etc.
So as you can see, "456" is found as a mismatch because the --- behind 456 in one panel match the --- before the 456 in the other panel.
1. TC finds the match "123"
2. It finds mismatch "(" and "/"
3. It finds again a match "(11)------", so "/111" is seen as
inserted text
4. It finds mismatch "-" and "4"
5. It finds again match "---", so "456" is seen as inserted text
6. It finds mismatch "4" and "-"
7. It finds again match "-----", so "456" in the other panel is seen as mismatch
etc.
So as you can see, "456" is found as a mismatch because the --- behind 456 in one panel match the --- before the 456 in the other panel.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I think dexter@md type dashes for visual purpose but you should replace each dash with one space and compare the two files
the following are four possibilties and their compare result:
file1.txt: (10 spaces before 456)
file2.txt: can be one of the following four cases: (7 spaces before 456) > 456 are not equal (colored RED in file2.txt)
(10 spaces before 456) > 456 are equal (colored BLACK in both files)
(13 spaces before 456) > 456 are not equal (colored RED in file1.txt)
(14 -or more- spaces before 456) > 456 are not equal (colored RED in both files)
it is supposed that when "Ignore repeated spaces" is checked, we get equal 456 in the above four cases
the following are four possibilties and their compare result:
file1.txt:
Code: Select all
123(11) 456 789
file2.txt: can be one of the following four cases:
Code: Select all
123/111(11) 456 789
Code: Select all
123/111(11) 456 789
Code: Select all
123/111(11) 456 789
Code: Select all
123/111(11) 456 789
it is supposed that when "Ignore repeated spaces" is checked, we get equal 456 in the above four cases
- ghisler(Author)
- Site Admin
- Posts: 50475
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
well, it usually does, but here you have a mismatch just before the dashes. Afterwards TC tries to re-sync the lines to find again matching text, but does it differently from how a human would see it...why "Ignore repeated spaces" does not ignore them?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com