Last active
May 23, 2019 13:06
-
-
Save sayz/01eeeef41b04be39521c503302eb2147 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file1 = open("wrong_ip.txt", encoding="utf-8") | |
wrongs = file1.readlines() | |
file2 = open("full_ip.txt", encoding="utf-8") | |
full_ip = file2.readlines() | |
file3 = open("match_ip.txt", "w") | |
match_full = [0,1,2] | |
for i in wrongs: | |
for j in range(len(full_ip)): | |
if i.rstrip() in full_ip[j]: | |
match_full.append(full_ip[j].rstrip()) | |
if full_ip[j].rstrip() not in match_full[:-1]: | |
print(full_ip[j].rstrip(), file=file3) | |
file1.close() | |
file2.close() | |
file3.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment