Compare 2 files and discard common lines

dwblas at gmail.com dwblas at gmail.com
Thu May 29 16:25:54 EDT 2008


On May 29, 1:36 am, loial <jldunn2... at googlemail.com> wrote:
> only those lines that appear in the 2nd file but not in the 1st file.

set(file_2_recs).difference(set(file_1_recs)) will give the recs in
file_2 that are not in file_1 if you can store both files in memory.
Sets are indexed and so are faster than lists.



More information about the Python-list mailing list