Source

OpenTools / python / 20120608 / aparse.py

Full commit
r = open("dumpdns","r")
r2 = open("iplist","r")

iplist = []
for line in r2:
    iplist.append(line.strip())

for line in r:
    splited = line.split(" ")
    count = 0
    for e in splited:
        if e == "A":
            if splited[count+1][-1] == ",":
                if splited[count+1][:-1] in iplist:
                    print splited[count-1],splited[count+1]
            else:
                if splited[count+1] in iplist:
                    print splited[count-1],splited[count+1]

        count+=1
    count = 0