Google Answers Logo
View Question
 
Q: Textural compare algorithms in vb.net using RichTextBox (or equivlant) controls. ( No Answer,   0 Comments )
Question  
Subject: Textural compare algorithms in vb.net using RichTextBox (or equivlant) controls.
Category: Computers > Algorithms
Asked by: jdware-ga
List Price: $100.00
Posted: 24 Aug 2003 12:42 PDT
Expires: 24 Aug 2003 18:32 PDT
Question ID: 248252
I'm writing an application which will compare (n) similar text files.
This can be accomplished by comparing two at a time. If you know of a
more optimal way of comparing (n) files where n > 2, I'm all ears.
These files will be compared in order i.e.: file1 <--> file2 <-->
file3 <--> ...

I need a textural compare algorithm or choice algorithms which will
allow me produce results similar to WinDiff (included with visual
studio) where I can detect additions, differences and deletions of
lines -- and for each different line, I need to show the word
differences. This must be displayed a RichTextbox or equivlant -- to
visually show the differences (for (n) files).

Currently, I load these text files into RichTextBox controls, and use
the .Lines array property to first compare lines -- then for lines
which are similar, compare the line word by word. For lines and words
which are different, I use the .Select() method to select the text in
question, then I call the .SelectionColor property to color the
different text. This way is too slow for larger files.

In addition to finding a more optimal compare algorithm, I believe if
I can compare the text before I load the text into the control, and
embed RTF codes in the text (to denote differences) I may be able to
further optimize the compare. I'm a little lost when it comes to
embedding RTF codes in the text, so the answer would have to touch on
the subject of embedding RTF codes in the text before or after loading
the RichTextBox (or equivlant) control.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy