Ability to ignore certain differences in "compare contents"

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
stepho-wrs
Junior Member
Junior Member
Posts: 5
Joined: 2022-02-15, 01:40 UTC

Ability to ignore certain differences in "compare contents"

Post by *stepho-wrs »

I often compare 2 files which are very similar expect that one of them has the string ABC and the other has the string XX in multiple places.
Obviously, compare will highlight these differences in red.

But sometimes I'd like to hide these particular differences and only see the remaining differences.

Eg, if I have 2 files a.txt and b.txt

a.txt:
[abc]
name=abc
option1=29
option2=37

b.txt:
[xxxx]
name=xxxx
option1=7
option2=37

It would be great if I could enter pairs of string (eg "abc" and "xxxx") somewhere and whenever the diff tool sees a difference with this pair then to not highlight it in red.
Even better if I can select existing highlighted differences, right click and have a menu option to add that pair to the difference list.
In this way, when comparing 2 config files like above I would only see the difference of 29 vs 7, not the unimportant (to me) differences of abc vs xxxx .

Thanks.
User avatar
nsp
Power Member
Power Member
Posts: 1944
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Ability to ignore certain differences in "compare contents"

Post by *nsp »

stepho-wrs wrote: 2022-02-16, 00:25 UTC I often compare 2 files which are very similar expect that one of them has the string ABC and the other has the string XX in multiple places.
Obviously, compare will highlight these differences in red.

But sometimes I'd like to hide these particular differences and only see the remaining differences.

Eg, if I have 2 files a.txt and b.txt

a.txt:
[abc]
name=abc
option1=29
option2=37

b.txt:
[xxxx]
name=xxxx
option1=7
option2=37

It would be great if I could enter pairs of string (eg "abc" and "xxxx") somewhere and whenever the diff tool sees a difference with this pair then to not highlight it in red.
Even better if I can select existing highlighted differences, right click and have a menu option to add that pair to the difference list.
In this way, when comparing 2 config files like above I would only see the difference of 29 vs 7, not the unimportant (to me) differences of abc vs xxxx .

Thanks.
To me the only way to do this is to create you own config file content plugin with dedicated comparison method. You will be able to program your own algorithm hat do not highlight section and name attribute...
User avatar
Horst.Epp
Power Member
Power Member
Posts: 7011
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Ability to ignore certain differences in "compare contents"

Post by *Horst.Epp »

I use Beyond Compare in TC.
You can define "unimportand Text" in the rules.
Windows 11 Home, Version 24H2 (OS Build 26100.4351)
TC 11.55 RC6 x64 / x86
Everything 1.5.0.1395a (x64), Everything Toolbar 1.5.5.0, Listary Pro 6.3.2.88
QAP 11.9.0.3 x64
stepho-wrs
Junior Member
Junior Member
Posts: 5
Joined: 2022-02-15, 01:40 UTC

Re: Ability to ignore certain differences in "compare contents"

Post by *stepho-wrs »

I was hoping for an addition to the built-in diff tool but using Beyond Compare is certainly a viable option.
Thank you.
Post Reply