Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #imports
- import os
- #Change directories
- os.chdir ("M:\Daily Testing")
- #User Input
- print "What is the name of the system being scanned?"
- sys = raw_input("> ")
- #Subfolder selected
- os.chdir (sys)
- os.chdir ("RESULTS")
- #variables
- tag = ["/tcp", "/udp"]
- fout = [sys + " Weekly Summary.csv"]
- import glob
- for filename in glob.glob("*.nmap"):
- with open(filename, "rU") as f:
- for line in f:
- if not line.strip():
- continue
- for t in tag:
- if t in line:
- fout.write(line)
- else:
- continue
- fout = [sys + " Weekly Summary.csv"]
- with open(sys+" Weekly Summary.csv", "w") as fout:
- <snip>
- import glob
- with open(sys + " Weekly Summary.csv", "w") as fout:
- for filename in glob.glob("*.nmap"):
- with open(filename, "rU") as f:
- for line in f:
- if not line.strip():
- continue
- for t in tag:
- if t in line:
- fout.write(line)
- else:
- continue
Add Comment
Please, Sign In to add comment