I'm trying to parse a file and extract 'src=172.16.148.27 dst=10.52.10.10' out of each line that contains 10.52.10.10, but get lost with writing the information and am not sure if I should .re at all.
import re infile = open("in.txt","r") outfile = open("out.txt", "w") for line in infile: re.match('src=*10.52.10.10') outfile.write(re.compile) ofile.close() wfile.close()
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor