So I have 2 files, `file1` and `file2`, of unequal size and at least a million `return separated` lines each. I want to match content from `file1` with `file2` and if a match exists, remove the same from `file1`. Example:

```
+------------+-----------+--------------------------+
| file1      | file2     | after processing - file1 |
+------------+-----------+--------------------------+
| google.com | in.com    | google.com               |
+------------+-----------+--------------------------+
| apple.com  | quora.com | apple.com                |
+------------+-----------+--------------------------+
| me.com     | apple.com |                          |
+------------+-----------+--------------------------+

```

My code looks viz. 

```
with open(file2) as fin:
        exclude = set(line.rstrip() for line in fin)

for line in fileinput.input(file1, inplace=True):
        if line.rstrip() not in exclude:
            print
            line,

```

Which just deletes all contents of `file1`. How can I fix that?
Thanks.