Query regarding set([])?

vox vox2000 at gmail.com
Fri Jul 10 08:52:10 EDT 2009


On Jul 10, 2:04 pm, Peter Otten <__pete... at web.de> wrote:
> You are probably misinterpreting len(s3). s3 contains lines occuring in
> "file1" but not in "file2". Duplicate lines are only counted once, and the
> order doesn't matter.
>
> So there are 119 lines that occur at least once in "file2", but not in
> "file1".
>
> If that is not what you want you have to tell us what exactly you are
> looking for.
>
> Peter

Hi,
Thanks for the answer.

I am looking for a script that compares file1 and file2, for each line
in file1, check if line is present in file2. If the line from file1 is
not present in file2, print that line/write it to file3, because I
have to know what lines to add to file2.

BR,
Andy






More information about the Python-list mailing list