I have 2 files (a.txt and shell.txt)
in a.txt there are 59 lines and I've extracted their domains with the regex
in shell.txt there are 5881 lines.
The domains from a.txt exists in shell.txt and I want to extract the entire line of shell.txt if the domain of a.txt exists in shell.txt
Unfortunately my loops are not working right so I would like to get some help from you guys.
Thanks.
import re
s1 = open('a.txt', 'r').read().splitlines()
s2 = open('shell.txt', 'r').read().splitlines()
for x in s1:
c1 = re.findall("\/\/(.*)\/",x.split("|")[0])[0]
for x2 in s2:
c2 = re.findall("\/\/(.*)\/",x2.split("|")[2])
if c1 == c2:
print x2