I am trying to take out the total number of IP addresses and the amount of hosts up from an .nmap file. In the following example I want to take out the value "512" and the value of "17".
# Nmap done at Tue Nov 27 10:09:18 2012 -- 512 IP addresses (17 hosts up) scanned in 143.58 seconds
I then want to store those values in two separate array's (total, online) so I can calculate a running total. I am having trouble coming up with a way to take out those specific values from that line. It will not always be 512 or 17; it could be smaller/larger.
I need to accomplish this in python. I already have code that parses through the file line by line. I just need a way to take out that data.
Any help will be much appreciated.
Thank you!