Click here to Skip to main content
14,299,038 members

Compare two text files word by word adn character by character and highlight the difference in characters .

shahrukhkiyani asked:

Open original thread
My question is that I have to made a program in c# windows form that Compare two text files word by word and character by character on same indexes and highlight the difference in characters in third file.for example

file1.txt :

abc def
jkl mno
tha


file 2.txt :

ab ghi
pqr stu
the

and after comparison the third file shows the result as

abc def ghi
jkl pqr mno stu
thea

colour the words which shows that the word is deleted,or inserted.

OR

c is deleted in file 2.
def is deleted in file 2.
ghi is inserted.
jkl is deleted in file 2.
mno is deleted in file 2.
pqr is deleted in file 2.
stu is deleted in file 2.
a is deleted in file 2.
e is inserted in file 2.

I have search maximum c# code sites and codes but i think no one have done this yet in c# can any on help me or have that code the code should be simple that begainers also understand it please send it on my email id gakhar023@gmail.com and upload it for others thanks.
God bless you all.
Tags: C#

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the The Code Project Open License (CPOL).




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100