comparing two files

Discussion of Emacs Lisp

comparing two files

Postby 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
mnjagadeesh
 
Posts: 1
Joined: Sat Jul 03, 2010 9:24 am

Re: comparing two files

Postby 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.
gugamilare
 
Posts: 406
Joined: Sat Mar 07, 2009 6:17 pm
Location: Brazil

Re: comparing two files

Postby 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.
calibraxis
 
Posts: 6
Joined: Mon Jul 05, 2010 12:22 am


Return to Emacs Lisp

Who is online

Users browsing this forum: No registered users and 2 guests

cron