Dear All

I want to develop an application to compare 2 input text file and show the difference with highlighted text in the first file itself.

Please assist how to do it Or any readymade software is there for effective file comparison.

Regards
Sasikumar

Recommended Answers

All 6 Replies

Member Avatar for leegeorg07

I'm not sure about VB but python has the difflib module

I'm not sure about VB but python has the difflib module
What happened to everyone ?? In one post i see someone says never in vb...But truth is it is ...hmmmmm Let me think in this case hehehehe...

You can compare two text boxes using IF And ELSE.You can highlight using selstart ..It is actually looks like Text or word find code..In that you can find the word typed by you in the entire textbox..Like this you can compare 2 text boxes.
Note:
VB is not limited .. so i am still searching..But in this case i know one hard and fullish way [ hoops i forgot it ...The method is you can bring one textbox data to another by one letter.I will explain using that code you can bring my name VINEETH in another textbox like first V then I .... At last H one by one ...
In your case you can bring texts in both boxes to a different 2 string like this .You can compare it when each letter passes to the string using IF.When you found any difference you can stop that passing and comparing .The advantage is here you can exactly spot the wrong place of error i think ..

Try it or if you don't know ; search the code for that or give me a little time to find that code hehehehe

I thought I answered this before but then again... could have been a connection hiccup

When comparing two text files for differences, there are many ways to accomplish this but since you have narrowed it down to a visual display, I would suggest that you use RTB's for the visual display.

Then, you need to define a little better on how you want to display these differences because once you come across the first difference, the rest of the file is different. Which means, if you want to only show the specific differences within the data itself, even if there are extra line breaks (vbNewLine), then your formula will need to be able to search for not only differences but commonalities also.

Good Luck

Hope you will do the needful from replying with the solution.
Thanks in Advance.

I'm not sure about VB but python has the difflib module[/B]
What happened to everyone ?? In one post i see someone says never in vb...But truth is it is ...hmmmmm Let me think in this case hehehehe...

You can compare two text boxes using IF And ELSE .You can highlight using selstart ..It is actually looks like Text or word find(code)..In that you can find the word typed by you in the entire textbox..Like this you can compare 2 text boxes.
Note :
VB is not limited .. so i am still searching..But in this case i know one hard and fullish way ( hoops i forgot it ...) The method is you can bring one textbox data to another by one letter.I will explain using that code you can bring my name VINEETH in another textbox like first V then I .... At last H one by one ...
In your case you can bring texts in both boxes to a different 2 string like this .You can compare it when each letter passes to the string using IF.When you found any difference you can stop that passing and comparing .The advantage is here you can exactly spot the wrong place of error ( i think .. )

Try it or if you don't know ; search the code for that or give me a little time to find that code hehehehe

open 2 file as binary
check byte to byte
and show the diff
you can use ritchtextbox to highligh text

there are number of tools for the purpose. Just use google with proper keyword for effective search.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.