[comp.unix.questions] Looking for "diff"-like code to find differences between two files

gft_robert@gsbacd.uchicago.edu (10/15/90)

-----
[sorry if this got posted multiple times, but it doesn't seem to show up at my
site]

I'm working on a project on the Mac in which we need to compare the text of two
files.  We need to do this on a character-by-character basis, not merely
line-by-line, because we need to go back and indicate which words/chars were
deleted and added.

I'm curious whether anyone has any code to suggest which does this.  Ideally we
need something which outputs some form of an ed script or something similar, so
that we can use this information in operating on the resulting difference file.

We were looking at the GNU diff routine, but from looking at the source it
seems that this may only output info on a line-by-line basis (we don't have the
man pages and haven't built it yet, so I don't know for sure).

While the resulting app may end up running under A/UX, basically it will be a
Macintosh app.  I'm posting this to the unix groups in the hope that there may
be a unix tool which we can adapt to our purposes.  Of course if someone has
some sample code which is not made for unix, that would be fine too.

One thing: the code should be able to handle large amounts of data.  Most of
our docs will be > 100 pages.

Any help/info very much appreciated!

Robert     
 

rh@smds.UUCP (Richard Harter) (10/18/90)

In article <1990Oct15.035844.162@midway.uchicago.edu>, gft_robert@gsbacd.uchicago.edu writes:
 -----
 
"I'm working on a project on the Mac in which we need to compare the text of two
 files.  We need to do this on a character-by-character basis, not merely
 line-by-line, because we need to go back and indicate which words/chars were
 deleted and added...
 
 We were looking at the GNU diff routine, but from looking at the source it
 seems that this may only output info on a line-by-line basis (we don't have the
 man pages and haven't built it yet, so I don't know for sure).
 
 While the resulting app may end up running under A/UX, basically it will be a
 Macintosh app.  I'm posting this to the unix groups in the hope that there may
 be a unix tool which we can adapt to our purposes.  Of course if someone has
 some sample code which is not made for unix, that would be fine too."

If you are mostly interested in document comparison on the MAC I can
recommend Docucomp from

	Advanced Software Inc.
	1095 E. Duane Ave #100
	Sunnyvale CA 94086

It does a character/word diff on two files, displays them side by side,
and marks differences with different fonts (deleted words are crossed out.)
This may be exactly what you are looking for.

If you must have a UNIX solution and can't find anything more appropriate
SMDS does have a character difference program.  It was designed to be
used in conjunction with binary file version control -- the output is
a specification of the number of bytes inserted and deleted at each change
point.  Contact us if all else fails.  However I suspect that docucomp does
what you want.
-- 
Richard Harter, Software Maintenance and Development Systems, Inc.
Net address: jjmhome!smds!rh Phone: 508-369-7398 
US Mail: SMDS Inc., PO Box 555, Concord MA 01742
This sentence no verb.  This sentence short.  This signature done.