Solved

Text comparison

Posted on 2002-06-25
4
158 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
ID: 7108915
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
ID: 7109035
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
ID: 7109855
0
 
LVL 3

Author Comment

by:philipleighs
ID: 7111199
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
proper way to parse url in delphi 2 168
Newbie Thread Programming 1 139
Create a path if not exists 7 69
Tviruailstringtree sort multi columns on header click 1 54
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

863 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

25 Experts available now in Live!

Get 1:1 Help Now