Solving file conflicts with WinMerge

Discuss anything related to portable freeware here.
Post Reply
Message
Author
User avatar
webfork
Posts: 10818
Joined: Wed Apr 11, 2007 8:06 pm
Location: US, Texas
Contact:

Solving file conflicts with WinMerge

#1 Post by webfork »

I do a lot of file comparison work so I came up with a quick how-to with portable tools...

---

If you run into an issue where two files aren't agreeing with each other, WinMerge is very good at solving this. My own issue is something that seems to keep coming up in a disagreement between SimpleNote on one device and AlephNote on another.

Image

(Note that later versions of Alephnote included a comparison tool for this issue, but I had to come up with something beforehand and in some ways I prefer it.)

You can quickly resolve this by just grabbing both files and pasting into WinMerge and selecting F5 to refresh. The differences will be highlighted in yellow (as below):

Image

---

If the files are always in the same directory:

One way to speed this up is to create a text file in that folder with the text below

"F:\PortableApps\WinMergePortable\WinMergePortable.exe" . .

.. save as .bat and launch, letting you quickly select both files and compare in the UI.

Image

If the files are in different parts of your computer

Replace both dots from the above example with full path names in quotes, as below:

"F:\PortableApps\WinMergePortable\WinMergePortable.exe" "c:\temp\logs\log1.txt" "c:\Program Data\logfiles\log1.txt"

TP109
Posts: 571
Joined: Sat Apr 08, 2006 7:12 pm
Location: Midwestern US

Re: Solving file conflicts with WinMerge

#2 Post by TP109 »

webfork wrote: Sat Jul 04, 2020 9:03 am If the files are always in the same directory:

One way to speed this up is to create a text file in that folder with the text below

"F:\PortableApps\WinMergePortable\WinMergePortable.exe" . .
Another way is to modify the above command to compare any 2 files from the same directory by dragging and dropping them onto the batch file or a shortcut to that batchfile:

Code: Select all

"F:\PortableApps\WinMergePortable\WinMergePortable.exe" %1 %2
Last edited by TP109 on Sun Jul 05, 2020 8:38 pm, edited 1 time in total.

User avatar
webfork
Posts: 10818
Joined: Wed Apr 11, 2007 8:06 pm
Location: US, Texas
Contact:

Re: Solving file conflicts with WinMerge

#3 Post by webfork »

TP109 wrote: Sun Jul 05, 2020 11:36 am Another way is to modify the above command to compare any 2 files from the same directory by dragging and dropping them onto the batch file or a shortcut to that batchfile:
Wow, that worked beautifully -- thanks!

Image

TP109
Posts: 571
Joined: Sat Apr 08, 2006 7:12 pm
Location: Midwestern US

Re: Solving file conflicts with WinMerge

#4 Post by TP109 »

The modified command will work even if the batch file and 2 files to be compared exist in separate directories.

User avatar
lintalist
Posts: 434
Joined: Sat Apr 19, 2014 12:52 am
Contact:

Re: Solving file conflicts with WinMerge

#5 Post by lintalist »

Depending on your file manager you might be able to use the same trick as the Drag & Drop batch file method by passing on the selected, active, files.

In TC there is a built-in file compare tool, Double commander too - the potential advantage is that if you have two panels (different folders) but the same file names it will automatically load the file with the same name from the opposite panel to compare it to, saving you the trouble of selecting the second file. You can of course manually select two files and compare by content. The built-in compare tool can be replaced with an external program, say Winmerge or something else.

I'm sure other file managers have similar options making it a bit easier to manage although the batch file is a good trick of course :)

User avatar
webfork
Posts: 10818
Joined: Wed Apr 11, 2007 8:06 pm
Location: US, Texas
Contact:

Re: Solving file conflicts with WinMerge

#6 Post by webfork »

lintalist wrote: Tue Jul 07, 2020 12:33 pm In TC there is a built-in file compare tool, Double commander too - the potential advantage is that if you have two panels (different folders) but the same file names it will automatically load the file with the same name from the opposite panel to compare it to, saving you the trouble of selecting the second file.
I'm using a somewhat older version of DoubleCommander but you're right that the comparison tool is baked right in. This is a somewhat old copy of that program so the newer version might be more effective:

Image
lintalist wrote: Tue Jul 07, 2020 12:33 pm I'm sure other file managers have similar options making it a bit easier to manage although the batch file is a good trick of course :)
Agreed. I went digging for a tool like this in Multi Commander (I downloaded the latest version to make sure) but only found a script that also uses WinMerge: http://forum.multicommander.com/forum/i ... opic=654.0

---

Anyway, I'm mainly looking at WinMerge because it's the most customizable and feature-rich, but I'm working on a post about a compare program inside Notepad++ that's maybe my favorite so far. To be continued ... (EDIT: the post I was planning on)

Post Reply