Solved

Text comparison

Posted on 2002-06-25
4
157 Views
Last Modified: 2010-04-04
Hi all.

Has anyone had to put a differencing engine into their apps? That's what I'm faced with. Part of the app records a history of small snippets of text (3k or so on average) that are held in a database. I need to be able to visually compare the text.

Something like WinDiff, VisualDiff, or the GNU diff engine or whatever, but I want to incorporate the engine into a Delphi app (or talk to a COM obj would be fine) so that I can present the results in my own format.

Anyone know of such a library?

Thanks,
Phil.
0
Comment
Question by:philipleighs
4 Comments
 
LVL 14

Expert Comment

by:AvonWyss
Comment Utility
Shall it be line-based? In this case, it's not that hard to write for yourself. Just compare two lines (let's call the A and B), if they are the same, go to the next pair. If they differ, search the A line in the next N (where N is the maximal edit distance) lines of B. If not found, skip to the next A, etc. Doing this, you'll resync (when you find matching line pairs) or you will eventually come to file end.
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
DLSuperC now has a way to invoke it with command line parameters, so you could display the results after it did its comparison.  It is very thorough and fast.

You can contact Don Ludlow (dlsuperc.com), the DLSuperC developer, about features you might need.  He's pretty responsive to feature requests.  He wrote this in Delphi.
0
 
LVL 8

Accepted Solution

by:
TOndrej earned 500 total points
Comment Utility
0
 
LVL 3

Author Comment

by:philipleighs
Comment Utility
TOndrej,

The component uses the Eugene Myers routine which is what I was hoping for.

I've looked at the code and it's suitable for my purposes.

Thanks,
Phil.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now