how to filter differences

Open discussion about WinMerge.

how to filter differences

Postby nhilo32 » Thu Aug 22, 2019 9:58 pm

I am comparing two large files with thousands of differences, but most of the differences are the same. Is there anyway to filter out the differences that are the same?
eg. VARCHAR --> VARCHAR2
I have tried using line filters, but the problem i am running into is that the difference between the two lines is the same but the characters before and after the change are different.
eg.
field1 VARCHAR(10), --> field1 VARCHAR2(10),
field2 VARCHAR(10), --> field2 VARCHAR2(10),
field3 VARCHAR(10), --> field3 VARCHAR2(10),
field4 INT(1), --> field4 NUMBER(1),

how do I filter so that of the differences listed above I only see the fourth one?
any light you could shed on this would be greatly appreciated.
nhilo32
 
Posts: 3
Joined: Thu Aug 22, 2019 9:42 pm

Re: how to filter differences

Postby nhilo32 » Tue Aug 27, 2019 2:08 pm

does anyone out there know how to do this? it seems like there must be some way to filter the differences, not just what gets compared.
nhilo32
 
Posts: 3
Joined: Thu Aug 22, 2019 9:42 pm

Re: how to filter differences

Postby DannyDan » Fri Sep 06, 2019 3:20 pm

Code: Select all
^\s*field\d+\s+VARCHAR(?:2|)\(\d+\)\s*,[^$]*?$

That regular expression pattern matches the following:
Code: Select all
field1 VARCHAR(10),
field1 VARCHAR2(10),
 field2 VARCHAR(10),
 field2 VARCHAR2(10),
field3 VARCHAR(10),
field3 VARCHAR2(10),


It does not match:
Code: Select all
field4 INT(1),
field4 NUMBER(1),


So, if you add that pattern as a Line Filter, it should ignore the changes you wanted to ignore and still show you changes for the lines it did not match.

If your variables are not actually called "field#" then you will need replace "field" in the regular expression to a list of the potential variable names such as: (?:address|city|state|zip)


I tend to test regular expressions within TextCrawler (the text search/replace tool I use for bulk text changes), but since WinMerge uses PCRE instead of .Net regexp engine, I use this site: for WinMerge filters: https://regex101.com/
DannyDan
 
Posts: 3
Joined: Wed Sep 04, 2019 2:03 am


Return to Open Discussion

Who is online

Users browsing this forum: Bing [Bot] and 12 guests

cron