Kamal | 15 May 07:54
Picon

looking for ways to get diff between two txt files

Hi,

I would really appreciate if someone help to find a way to calculate
delta (diff) between two similar text files. I have looked at difflib
and found related script at this site
http://www.java2s.com/Code/Python/Utility/Printfilediffsincontextunifiedorndiffformats.htm

Is there a simple way to just get delta between two files? e.g. I have
below two files and the delta between these two files is in
diff_output.txt

file1.txt
hello world

file2.txt
hello world
hello python

diff_output.txt
hello python

--

-- 
Thanks,
Kamal
_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor

Kent Johnson | 15 May 12:49
Gravatar

Re: looking for ways to get diff between two txt files

On Thu, May 15, 2008 at 1:58 AM, Kamal <kpsingh <at> gmail.com> wrote:
> Hi,
>
> I would really appreciate if someone help to find a way to calculate
> delta (diff) between two similar text files.

This example would be pretty easy to modify to do what you want:
http://personalpages.tds.net/~kent37/blog/arch_m1_2004_06.html#e47

Kent
_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor


Gmane