(More) Compare-Tool Tips

Previously, I wrote about WinMerge, a free, open source compare tool for the Windows platform, that allows you to compare two files side-by-side and optionally edit them, or merge them. I gave a few tips on how to get started taking advantage of it. Those tips were specific to WinMerge, but there are plenty of other compare tools out there, both free and commercial, for the various platforms.

So, although I’m offering up the following additional tips with WinMerge in mind, you may find them useful with any tool that allows you to compare two files (and edit them):

winmerge_compare_options.jpg
Tip #5: Tweak the Compare Settings. There are numerous options for controlling what is significant and what should be ignored during comparisons (whether or not white space matters, whether or not upper case vs. lower case matters, whether or not the lines are terminated in DOS style or UNIX style, etc.). So, if the tool shows you differences in very large blocks (perhaps even “this whole file is different than that whole file”), which, of course, is not very informative, then try tweaking the settings to see if the comparisons become more fine-grained. Also, if the files contain a lot of repeated or similar lines, the moved-block detection might get in the way. WinMerge might be fooled into thinking that two sets of lines that happen to be the same represent a moved block, when really they are just separate occurrences of the same thing. If that happens, try turning off the moved-block detection.

Tip #6: Break up long blocks. WinMerge has a pretty good facility for detecting moved blocks, but sometimes you have to coax it. If WinMerge shows you two large blocks of text that differ, but you suspect that the large blocks are really several small blocks that have merely shifted in order, then try inserting blank lines in both files and then re-compare. (WinMerge even has an option to re-compare automatically whenever you make a change.)

Tip #7: Moved Blocks Are Color-Coded But Sometimes Hidden. The default settings highlight differences in yellow, the “current” difference in pink, and moved blocks in brown. However, the current color (pink) trumps the other two. So, you might need to arrow up or down off of the “current” difference in order to see if the underlying nature is that of an ordinary difference (yellow), or a moved block (brown).

Tip #8: Plug It In. WinMerge makes a great third-party compare tool for other software, such as version-control systems like Subversion. Such software usually comes with a built-in comparison feature that is read-only. So, being able to substitute an alternate compare tool that allows editing means it’s that much easier to make last-minute corrections to typos and the like.

Trackbacks & Pings

Comments

  1. i have abt 1500 word & .xls files across 2pcs connected by lan including many du/triplicates. how can i keep only 1 unique ver. of a file?

  2. mrbho: WinMerge has a mode for comparing whole file folders to display the differences file-by-file. In the case of Word and XL files WinMerge can only tell you if they are identical or different (but not how they are different), since they are binary files. But, it sounds like that’s all you need. The folder display mode of WinMerge has a delete function built in, so deleting the duplicates can be quick work. (Note: This all assumes that the duplicate copies still have the same filename. If they don’t, then WinMerge can’t help.) Give me a day or two, and I’ll write up a step-by-step example and post it.

  3. With plugin “xdocdiff”, you can compare Word, Excel… files.

    http://freemind.s57.xrea.com/xdocdiffPlugin/en/index.html

Post a Comment


Your email is never published nor shared. Required fields are marked *



© 2006-2007 Maxim Software Corp.  All rights reserved.