擅长:python、mysql、java
<pre><code>with open("file1.txt") as f, open("file2.txt") as f1:
items = set(line.rstrip() for line in f)
filtered = [line for line in f1 if " ".join(line.split()[::4]) in items]
with open("file2.txt","w") as f3:
f3.writelines(filtered)
</code></pre>