I think it's file2 is filtered by file1. Right?
I assume that the file1 is not ordered. (If it's ordered, there is another efficient solution)
with open('file1') as file1, open('file2') as file2:
my_filter = [line.strip().split() for line in file1]
f3 = [line.strip() for line in filter(lambda x: x.strip().split()[1:5] in my_filter, file2)]
# to see f3
for line in f3:
print line
First, build filter my_filter = [line.strip().split() for line in file1]
which contains
[['132.227', '49202', '107.21', '80'], ['132.227', '49202', '107.21', '80'], ['132.227', '49200', '107.220', '80'], ['132.227', '49200', '107.220', '80'], ['132.227', '49222', '207.171', '80'], ['132.227', '49339', '184.730', '80'], ['132.227', '49291', '930.184', '80']]
then using filter
, filter the data. This code works on Python 2.7 +