Sunday, April 22, 2012

KDiff3 for File Comparison

There are times you want to compare two text files.  Say you have made one program by modifying another program.  Then you want to see what those differences are.  KDiff3 allows you to compare the files.  It is free.  It is a very useful tool and I recommend it for Windows platforms.

Go to the KDiff3 home page at Source Forge:  http://kdiff3.sourceforge.net/
On the left-hand side of this webpage is a Navigation Menu.

Click on "Download" at the left.  On the next page, click on the button that says "Download  Latest Version."

 Last time I looked it was  KDiff3-64bit-Setup_0.9.98-2.exe and save the program a Downloads folder, do your virus scan on the file, then launch it and accept the defaults. There are a few tricks to using it to its full capability.

When you compare two files and they are identical, you get a quick and easy to understand response:  a dialog window that tells you the files are identical.
If the files are different, the tool will show the files in two windows, side-by-side, with the windows highlighting the differences.  The way you compare is to right-click on one file, select KDiff3, select the "Save" menu item.  Then you repeat the process with the other file but select "Compare" instead.  The tool will compare against the file you chose to "Save."


If you use code source control tools like CVS or Subversion, then you know that those tools allow you to use comparison tools to see the differences between different versions of the code in source control.  But if you are new to programming, then KDiff3 will be helpful.

No comments:

Post a Comment

Comments require my approval before they appear. Be patient. It will take a day or two for your comment to appear.