winmerge icon indicating copy to clipboard operation
winmerge copied to clipboard

File compare: Is it possible to show only "left-only" or "right-only" lines?

Open patric-r opened this issue 4 years ago • 5 comments

Question here.

First of all: WinMerge is a fantastic tool.

I need to compare two files which have many lines in common (with and without differences within such lines) but a few lines do only appear on the left or on the right file. WinMerge perfectly detects that and shows such lines only in the left or right pane.

Is there a way in WinMerge to hide all lines which appear on both files so that only the left-only or right-only lines remain?

Keep up the great work!

patric-r avatar Aug 19 '21 12:08 patric-r

Perhaps a little different from what you're looking for, WinMerge has the ability to hide matching lines.

You can hide matching lines by selecting View → Diff Context → 0 Lines menu item as shown below.

image

sdottaka avatar Aug 19 '21 12:08 sdottaka

This will hide all the lines which are present in both files. However, it will still show the lines which are present in both files but different (which I want to exclude as well).

Consider file a.txt with the following content:

1;A
2;A
3;A
4;A
5;A
6;A
8;A
9;A

Consider file b.txt with the following content:

1;A
2;A
4;B
5;A
7;A
8;A
9;A

Comparing those two files in most recent WinMerge with the default options shows the following:

image

You can see that WinMerge successfully detected that line "4;A" is only present in a.txt and showing it as missing (gray). I am looking for an option which only shows the "gray"-marked lines (so in the above example, I would see nothing in the left pane, and "4;A" in the right pane.

Of course, this all depends on the comparison method and file contents if it can proper distinguish between "changed" and "non-existing" lines but in my case, the "gray"-detection works well and I'd like to see only those lines.

patric-r avatar Aug 19 '21 14:08 patric-r

Ideally, WinMerge would have another filter functionality:

  • show/hide identical lines
  • show/hide modified lines
  • show/hide left-only lines (gray lines in the right pane)
  • show/hide right-only lines (gray lines in the left pane)

By default, all 4 filter options are enabled to match existing behavior (show all lines)

patric-r avatar Aug 19 '21 14:08 patric-r

Any news on this? If i have 3 lines in first file and 2 lines in second, how can i add third line to second file? Its very slow to do one by one if i have 100+ of missing lines...

AcTiViSioN911 avatar Aug 30 '22 18:08 AcTiViSioN911