# I need an utility to compare text files....

**URL:** <https://boards.straightdope.com/t/i-need-an-utility-to-compare-text-files/165488>\
**Category:** Factual Questions\
**Created:** [March 31, 2003, 5:25pm UTC](https://boards.straightdope.com/t/i-need-an-utility-to-compare-text-files/165488 "2003-03-31T17:25:47Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crowbar\_of\_Irony\_3](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@Crowbar\_of\_Irony\_3](https://boards.straightdope.com/u/Crowbar_of_Irony_3)\
**Post date:** [March 31, 2003, 5:25pm UTC](https://boards.straightdope.com/t/i-need-an-utility-to-compare-text-files/165488/1 "2003-03-31T17:25:47Z")

</div>

I would have done a search for it but I don’t know what this utility is called - just what it does.

Basically, this utility compares two text files and reports the lines those two text files differ from each other. IRIC, Unix has command for this (grep??) but I don’t run Unix, but a Windows 98 on a PC.

Thanks in advances!

---

<div class="post-metadata">

**Author:** ![bashere](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bashere](https://boards.straightdope.com/u/bashere)\
**Post date:** [March 31, 2003, 5:31pm UTC](https://boards.straightdope.com/t/i-need-an-utility-to-compare-text-files/165488/2 "2003-03-31T17:31:32Z")

</div>

The unix utility is called diff (or perhaps “df”, it’s been a while). There is a Windows utility called WinDiff that does the same thing. I believe it to be shareware.

---

<div class="post-metadata">

**Author:** ![bashere](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bashere](https://boards.straightdope.com/u/bashere)\
**Post date:** [March 31, 2003, 5:38pm UTC](https://boards.straightdope.com/t/i-need-an-utility-to-compare-text-files/165488/3 "2003-03-31T17:38:37Z")

</div>

Sorry, I should have mentioned that there is a DOS utility that might do what you need, if your needs are not particularly involved. In a DOS window, try using the command fc (File Compare). The command is

fc filename1.txt filename2.txt

Output can be redirected to a file by typing

fc filename1.txt filename2.txt \> outputfile.txt

WinDiff uses a better comparison algorythm, so there are fewer false positives. fc will work if you just need something sort of quick.

If you are unfamiliar with the DOS prompt, WinDiff will definitely make life easier for you.

---

<div class="post-metadata">

**Author:** ![Opengrave](https://avatars.discourse-cdn.com/v4/letter/o/919ad9/32.png) [@Opengrave](https://boards.straightdope.com/u/Opengrave)\
**Post date:** [March 31, 2003, 5:42pm UTC](https://boards.straightdope.com/t/i-need-an-utility-to-compare-text-files/165488/4 "2003-03-31T17:42:17Z")

</div>

MS Word will also do this. Load one text file then TOOLS-\>TRACK CHANGES-\>COMPARE DOCUMENTS. It will ask you for the second document then show the differences.

---

<div class="post-metadata">

**Author:** ![Crowbar\_of\_Irony\_3](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@Crowbar\_of\_Irony\_3](https://boards.straightdope.com/u/Crowbar_of_Irony_3)\
**Post date:** [March 31, 2003, 5:44pm UTC](https://boards.straightdope.com/t/i-need-an-utility-to-compare-text-files/165488/5 "2003-03-31T17:44:49Z")

</div>

Thanks…

I am quite convinced that I could learn something new everyday if I try!

---

<div class="post-metadata">

**Author:** ![DarrenS](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@DarrenS](https://boards.straightdope.com/u/DarrenS)\
**Post date:** [March 31, 2003, 8:21pm UTC](https://boards.straightdope.com/t/i-need-an-utility-to-compare-text-files/165488/6 "2003-03-31T20:21:51Z")

</div>

If you are interested in doing this visually, I can **very highly** recomment CompareIt. [www.grigsoft.com](http://www.grigsoft.com) It’s shareware, but well worth the (small) registration fee. As far as I can see it’s some guy working out of his house in Eastern Europe, but I’ve been using this software professionally for a couple of years and it is fabulous.

Disclaimer: I have no financial interest in this, I just think it’s an excellent piece of software.

---

<div class="post-metadata">

**Author:** ![DarrenS](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@DarrenS](https://boards.straightdope.com/u/DarrenS)\
**Post date:** [March 31, 2003, 8:27pm UTC](https://boards.straightdope.com/t/i-need-an-utility-to-compare-text-files/165488/7 "2003-03-31T20:27:04Z")

</div>

Also, if you really really want to do this in the “command line” UN\*X-like style, a lot of the UNIX utilities (including diff) are available [here](http://unxutils.sourceforge.net/).

---

<div class="post-metadata">

**Author:** ![Futile\_Gesture](https://avatars.discourse-cdn.com/v4/letter/f/f05b48/32.png) [@Futile\_Gesture](https://boards.straightdope.com/u/Futile_Gesture)\
**Post date:** [March 31, 2003, 8:43pm UTC](https://boards.straightdope.com/t/i-need-an-utility-to-compare-text-files/165488/8 "2003-03-31T20:43:28Z")

</div>

Try [Beyond Compare](http://www.scootersoftware.com/). Compares files and directories. Syncs them, batch processes, lots of stuff. I’ve found it invaluable.

---

<div class="post-metadata">

**Author:** ![Kalashnikov](https://avatars.discourse-cdn.com/v4/letter/k/2bfe46/32.png) [@Kalashnikov](https://boards.straightdope.com/u/Kalashnikov)\
**Post date:** [March 31, 2003, 8:58pm UTC](https://boards.straightdope.com/t/i-need-an-utility-to-compare-text-files/165488/9 "2003-03-31T20:58:15Z")

</div>

I use ExamDiff from [www.prestosoft.com](http://www.prestosoft.com)

compares text or binary files or Word documents, compares directories, works either as an interactive two-files-at-a-time editor or in batch mode etc.

---

<div class="post-metadata">

**Author:** ![DarrenS](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@DarrenS](https://boards.straightdope.com/u/DarrenS)\
**Post date:** [March 31, 2003, 9:20pm UTC](https://boards.straightdope.com/t/i-need-an-utility-to-compare-text-files/165488/10 "2003-03-31T21:20:23Z")

</div>

ExamDiff compares Word documents side-by-side?!? I’ve been looking for this feature for a LONG time. The built-in compare in Word is (IMHO) not much use.

---

<div class="post-metadata">

**Author:** ![asterion](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@asterion](https://boards.straightdope.com/u/asterion)\
**Post date:** [March 31, 2003, 9:28pm UTC](https://boards.straightdope.com/t/i-need-an-utility-to-compare-text-files/165488/11 "2003-03-31T21:28:49Z")

</div>

Technical hijack:

When it does this, what is it comparing? Code or text?

---

<div class="post-metadata">

**Author:** ![Kalashnikov](https://avatars.discourse-cdn.com/v4/letter/k/2bfe46/32.png) [@Kalashnikov](https://boards.straightdope.com/u/Kalashnikov)\
**Post date:** [March 31, 2003, 10:09pm UTC](https://boards.straightdope.com/t/i-need-an-utility-to-compare-text-files/165488/12 "2003-03-31T22:09:09Z")

</div>

Ummm… err… actually I haven’t really used it for Word documents, but I thought I’d read that somewhere. So I just now tried it. You do see some of the control codes, font names etc. but others just show up as blocks or other higher ASCII characters.

You can download a trial version for free.

---

<div class="post-metadata">

**Author:** ![Kalashnikov](https://avatars.discourse-cdn.com/v4/letter/k/2bfe46/32.png) [@Kalashnikov](https://boards.straightdope.com/u/Kalashnikov)\
**Post date:** [March 31, 2003, 10:15pm UTC](https://boards.straightdope.com/t/i-need-an-utility-to-compare-text-files/165488/13 "2003-03-31T22:15:39Z")

</div>

Oh, and I’m talking about ExamDiff Pro ($35). The plain ExamDiff (free) only handles text files and only does comparisons, no editing.

---

<div class="post-metadata">

**Author:** ![Khadaji](https://avatars.discourse-cdn.com/v4/letter/k/9e8a1a/32.png) [@Khadaji](https://boards.straightdope.com/u/Khadaji)\
**Post date:** [March 31, 2003, 11:34pm UTC](https://boards.straightdope.com/t/i-need-an-utility-to-compare-text-files/165488/14 "2003-03-31T23:34:41Z")

</div>

goto [www.downloads.com](http://www.downloads.com) and look for winmerge. It is a good tool and is free.
