Page 1 of 1

comparing two files

Posted: Sat Jul 03, 2010 10:05 am
by mnjagadeesh
Hello,
I have two files text1 and text2. these two file share some lines in common. I want to find out what are not common.
assume contents of files:
text1:
a
b
c
and text2:
a
r
h
b
w
e
c

so I guess line comparision is good. I used perl to get my job done but want to know how to do it in emacs. I have started learning emacs-lisp. Any piece of code would be helpful.

Thanks

Re: comparing two files

Posted: Sun Jul 04, 2010 7:02 am
by gugamilare
Take a look at the function diff-buffer-with-file and the others functions started by diff.

Re: comparing two files

Posted: Mon Jul 05, 2010 12:41 am
by calibraxis
Also check out ediff-files and relatives like ediff-buffers. They're easy to use, and ediff-revision is good with version control.