I have a school project that requires me to take values from a text document and send them to a different text document(In sorts just simplifying the text document). I need to be able to find lines with certain information(already done) and then take just the last value in that list. This is all coded with Python.
The value I'm taking is an IP address so it will always be an integer. However, some of the IP values have parenthesis around them and if possible I also need to remove just the parenthesis and keep the IP inside of them.
:for i, line in enumerate(searchlines):
if "Nmap scan report for" in line:
for l in searchlines[i:i+1]: IPlog.write(l)
print: