Created
March 19, 2014 15:48
-
-
Save siddartha/9644601 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
set1 = open('set1.txt','r') | |
set2 = open('set2.txt','r') | |
output = open('diff.txt','w') | |
eachhost1 = set1.read().splitlines() | |
#print eachhost1 | |
eachhost2 = set2.read().splitlines() | |
#print eachhost2 | |
for host2 in eachhost2: | |
if host2 in eachhost1: | |
print "Matched with: "+host2 | |
else: | |
domain = "domain:"+host2+"\n" | |
output.write(domain) | |
set1.close() | |
set2.close() | |
output.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment