Advertisement
RabiRavioli

Untitled

Jun 6th, 2023
968
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. import re
  2. import sys
  3.  
  4. args = sys.argv
  5. if len(args) < 2:
  6.     print("Pass the path to the file to be read.")
  7.     quit()
  8.  
  9. print("Opening "+args[1])
  10. txtf = open(args[1], 'r')
  11. txt = txtf.read()
  12. txtf.close()
  13.  
  14. matches = re.findall("Netbios Name:.*\nIP:.*\n", txt)
  15. print(matches)
  16.  
  17. print("Opening output file")
  18. outf = open('output.txt', 'w+')
  19. outf.writelines(matches)
  20. outf.close()
  21.  
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement