2008/5/29, loial <[EMAIL PROTECTED]>:
I have a requirement to compare 2 text files and write to a 3rd file
only those lines that appear in the 2nd file but not in the 1st file.

En Thu, 29 May 2008 18:08:28 -0300, BJörn Lindqvist <[EMAIL PROTECTED]> escribió:

Open('3rd','w').writelines(set(open('2nd').readlines())-set(open('1st')))

Is the asymmetry 1st/2nd intentional? I think one could omit .readlines() in 2nd file too.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to