Is there any way to write my own plugin for Compare by Content function, please? I'm comparing tons of sources and logs, and this feature could be very helpful for me.
As an example, simple solution can be some sort of OnPrepareLineForCompare(lpBuffer: LPWSTR; szBuffer:DWORD) function . Using this function I can simply remove / replace timestamps and other specific texts (but only for compare)
Original:
19881250 083324 515 00000 SERVER:TWExchange Create <> 20210322 220636 832 00000 SERVER:TWExchange Create
19881250 083324 505 00000 SERVER:TWSysData Create <> 20210322 220636 832 00000 SERVER:TWSvsData Create
19881250 083324 512 00001 SERVER:TWRebate Create <> 20210322 220636 833 00001 SERVER:TWRebate Create
...
using OnPrepareLineForCompare i can temporarily change content for compare so:
Prepared:
00000000 000000 000 00000 SERVER:TWExchange Create <> 00000000 000000 000 00000 SERVER:TWExchange Create
00000000 000000 000 00000 SERVER:TWSysData Create <> 00000000 000000 000 00000 SERVER:TWSvsData Create
00000000 000000 000 00000 SERVER:TWRebate Create <> 00000000 000000 000 00000 SERVER:TWRebate Create
...
and finally will be just the different char 'y' <> 'v' in the TWSysData marked red and just this line gray - as line with differences.
Thank You
Plugins for Compare by Content
Moderators: Hacker, petermad, Stefan2, white
Re: Plugins for Compare by Content
Compare by content doesn't support plugins. You can configure external program instead. Popular options are WinMerge and Beyond Compare. Just add or change "CompareTool" key under [Configuration] sction in your main ini file. Of course you can also write your own utility.
Re: Plugins for Compare by Content
I know Winmerge (I wrote my WinMerge filter for that), but TC Compare is way more friendly, nicer and better. Maybe I'll give a chance to Beyond Compare. Anyway, thank You.
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Plugins for Compare by Content
If you just want to skip characters, you can already do this with an undocumented switch.
[Configuration]
CompareSkipFirstL=26
CompareSkipFirstR=26
This would skip the first 26 characters on both sides and compare only those behind. This isn't documented in the help because when you forget to remove it, it will be applied to all other files too. I recommend that you start TC with a separate ini file via /i= switch where this option is enabled so you don't accidentally use it for files without such a prefix.
[Configuration]
CompareSkipFirstL=26
CompareSkipFirstR=26
This would skip the first 26 characters on both sides and compare only those behind. This isn't documented in the help because when you forget to remove it, it will be applied to all other files too. I recommend that you start TC with a separate ini file via /i= switch where this option is enabled so you don't accidentally use it for files without such a prefix.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Plugins for Compare by Content
OMG, I knew it. You're god. I created new ini as suggested and it works like a charm. Thank You very much!
Re: Plugins for Compare by Content
For those, who'll find this useful too: I've set in second configuration other background color for compare, so it is immediately clear, that "alternate" compare method is used.