1

I would like to be able to python script to process a list of IP addresses from a txt file and then confirm whether they are accessible or responding IP Addresses within a excel file.

I have seen the following, which I have used as a base but it doesn't seem to work or work as I would expect;

https://www.geeksforgeeks.org/extract-ip-address-from-file-using-python/

I was going somewhere along the lines of;

import re 
import csv 
f = open('C:/Users/dir/dir/iplogs.txt', 'r') #Text file with many ip address 
o = f.read() 
ip1 = re.findall( r"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}", o ) 
hosts = ip1 
for host in hosts: 

However then I couldn't quite figure out how to manage this from here.

Funlamb
  • 551
  • 7
  • 20

0 Answers0