WinMerge : how to ignore specific words in a comparison?
Asked Answered
U

3

11

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 ?

Unbraid answered 29/3, 2011 at 8:38 Comment(0)
F
7

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).

Frenzy answered 19/5, 2020 at 6:54 Comment(1)
This one works for me. One thing though, when comparing folders, it seems that the Prediffer is not applied to the files. How can I apply the prediffer when comparing folders?Interoffice
D
3

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).

Dominicadominical answered 11/9, 2017 at 19:10 Comment(0)
B
1

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.

Bierman answered 9/6, 2011 at 11:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.