loial wrote:
> 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.

   lines_in_file2 = set(open("file2").readlines())
   for line in open("file1"):
       if line not in lines_in_file2:
           print line

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

Reply via email to