i think you can parse each line to get the name,port,ip.
str =
index1 = str.find(
index2 = str.find(
elem1 = str[0:index1]
elem2 = str[index1+1:index2]
elem3 = str[index2+1:]
ip = elem3[0:elem3.find(
after that, you can calculate the port and verify it.