comparing two files

Discussion of Emacs Lisp
Post Reply
mnjagadeesh
Posts: 1
Joined: Sat Jul 03, 2010 9:24 am

comparing two files

Post by mnjagadeesh » Sat Jul 03, 2010 10:05 am

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

gugamilare
Posts: 406
Joined: Sat Mar 07, 2009 6:17 pm
Location: Brazil
Contact:

Re: comparing two files

Post by gugamilare » Sun Jul 04, 2010 7:02 am

Take a look at the function diff-buffer-with-file and the others functions started by diff.

calibraxis
Posts: 6
Joined: Mon Jul 05, 2010 12:22 am

Re: comparing two files

Post by calibraxis » Mon Jul 05, 2010 12:41 am

Also check out ediff-files and relatives like ediff-buffers. They're easy to use, and ediff-revision is good with version control.

Post Reply