12

Is there a tool for comparing two lines of text?

All the tools I have compare on a line level, when I really need a character level diff in the line.

Windows or *nix, GUI or command line, I don't care.

C. Ross
  • 6,344
  • 1
    See http://superuser.com/questions/43270/file-compare-recommendation most apps highlight differences within a line too. – ChrisF May 25 '10 at 21:14
  • @ChrisF I'm already using WinMerge, and it does ... ok, but not exactly what I'm looking for. – C. Ross May 27 '10 at 00:14

4 Answers4

7

I use vimdiff often to compare two files side by side. vimdiff in color mode will highlight all differences between corresponding lines on each side. I'm using it to look for different characters on two different lines (in different files) right now.

5

kdiff is one open source diff utility that shows character by character differences as well as line by line. I'm sure there are others. Here's link for kdiff: http://kdiff3.sourceforge.net/

1

DiffMerge does pretty good at highlighting word or character differences. Better than WinMerge, IME.

afrazier
  • 23,185
0

Use this perl script from the git project.

Steven Lu
  • 3,668