开发者

WinMerge : how to ignore specific words in a comparison?

开发者 https://www.devze.com 2023-02-20 16:26 出处:网络
When I compare 2 files with WinMerge on Windows platform, do you know how could I ignore 开发者_运维技巧specific words ?

When I compare 2 files with WinMerge on Windows platform, do you know how could I ignore 开发者_运维技巧specific words ?

I mean I wanna say to WinMerge : "Don't care about that list of words : house, garden, etc."

An so when comparing those 2 lines :

the house is at london

&

the bus is at london

then no difference will be displayed since I don't care about the word house...

Any idea ?


In winmerge 2.16 (at least) (2020-05), you can use menu Plugins > Plugin Settings...

Click on PrediffLineFilter.sct, then click on the "Plugin Settings..." button, check in "Use RegExp" check box in the corresponding column. In the "Find what" column, specify a regexp and leave the "Replace with" cell empty. Close this plugin configuration window. Then, in the Plugins > Prediffer menu, select PrediffLineFilter.sct.

You can then turn off this filter plugin using menu Plugins > Prediffer > No Prediffer (normal).


I know its been a while since this was asked, but since this shows up as a top match when searching for this topic, I thought I'd add to it...

As far as I can tell, WinMerge STILL doesn't have this functionality directly. You have 2 options:
1) Write your own plugin for WinMerge. It does seem to be possible to do what you want that way if you wish to invest the time.
2) Get Meld. It includes the ability to use regex to ignore the parts of a line you don't want compared. For example, if you just put "word" in the text filter preferences it will ignore "word" and compare all other parts of the line. I use this to compare dmesg logs in Linux, ignoring the timer field at the start with "^[.*?]" (ignore everything between the initial brackets, non-greedy).


I am looking at the moment for something similar, so perhaps this may be helpful for you:

WinMerge does not allow to filter parts of a line. If a line filter matches, the whole line is ignored. See http://manual.winmerge.org/Filters.html for an explanation of line filters.

So if there is a difference other than the word bus and house in it, the line will be ignored as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号