Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- import sys
- args = sys.argv
- if len(args) < 2:
- print("Pass the path to the file to be read.")
- quit()
- print("Opening "+args[1])
- txtf = open(args[1], 'r')
- txt = txtf.read()
- txtf.close()
- matches = re.findall("Netbios Name:.*\nIP:.*\n", txt)
- print(matches)
- print("Opening output file")
- outf = open('output.txt', 'w+')
- outf.writelines(matches)
- outf.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement