473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Compare two strings, show differences

I want to be able to easily see what changes were made from original
to updated sentences (words added/removed/changed). I'm not too concerned about speed, just looking for something. The compared text will be anywhere from a word or two to multiple paragraphs.

An example:

Original sentence:
The brown dog ran outside at night. During the day, the brown dog slept.

Updated sentence:
The big brown dog ran outside when dark. During the day, it slept.
Ideally, the solution would display the differences in the browser, but I'm open to other ideas (creating txt documents out of the strings and comparing them with Word... but that's a question for another discussion area, purchase something third party, etc.).

Most of what I've found shows which line of text was modified. I'm looking for word differences.

Thank you,
Nathan Rosaaen


Jul 21 '05 #1
2 3308
Nathan,
If you need third party tool, check my Compare It! from
http://www.grigsoft.com/.

If you want to implement it yourself, search for LCS (Longest Common
Subsequence) realization. It will find difference between 2 strings on
char level. If you need word level only, just hash words, your text
will become set of hashes. Same algorithm will compare results and get
you word differences.

If you will have more questions on topic, feel free to contact me
through site's form.

Regards,

Igor Green
http://www.grigsoft.com
Compare It! + Synchronize It! : Files and folders comparison never was
easier!
Jul 21 '05 #2
BeyondCompare

"Nathan Rosaaen" <Na***********@discussions.microsoft.com> wrote in message
news:65**********************************@microsof t.com...
I want to be able to easily see what changes were made from original
to updated sentences (words added/removed/changed). I'm not too concerned about speed, just looking for something. The compared text will be anywhere
from a word or two to multiple paragraphs.
An example:

Original sentence:
The brown dog ran outside at night. During the day, the brown dog slept.

Updated sentence:
The big brown dog ran outside when dark. During the day, it slept.
Ideally, the solution would display the differences in the browser, but I'm open to other ideas (creating txt documents out of the strings and
comparing them with Word... but that's a question for another discussion
area, purchase something third party, etc.).
Most of what I've found shows which line of text was modified. I'm looking for word differences.
Thank you,
Nathan Rosaaen

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: roni | last post by:
hi. is there a tool that compare 2 vs.net projects and show the differences in code ? (in text..) such tool will help me alot to see changes i made between backups for example. have a...
4
by: Maur | last post by:
Hi all, I have 2 tables say t_OLD and t_NEW. The new has corrections for audit purposes. They are identical in all respects (i.e. new is a copy of old and then changes are made to t_new) ...
5
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields in the old database with records and fields in the...
1
by: Prakash RudraRaju | last post by:
Hi, I have recently migrated MSAccess Tables (nearly 120) to MySQL. To test successful migration I want to compare all tables. I have linked MySQL tables through ODBC connection. I want to...
4
by: Sasidhar Parvatham | last post by:
Hi All, How do I compare two strings and get all the positions where there is a difference between them? Thanks, Sasidhar
2
by: Nathan Rosaaen | last post by:
I want to be able to easily see what changes were made from original to updated sentences (words added/removed/changed). I'm not too concerned about speed, just looking for something. The compared...
3
by: Twinkle | last post by:
HI there i want to compare between two strings char by char.every strings having a word document.first string name is strFileName and second string name is strFilename1. i want to compare...
0
by: bobbymusic | last post by:
In my form I have two rich text boxes.In both of them I put two different text files(.txt or .rtf).I looking for some code to compare them, and to have the result as marked differences into the...
1
by: Neilen Marais | last post by:
Hi I'm trying to compare some text to find differences other than whitespace. I seem to be misunderstanding something, since I can't even get a basic example to work: In : d =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.