I'm not sure if that can be done with $read. As it only finds the 1st instance of the search parameter. You COULD put all of the ips after one another in the text file.

Like joe - 127.0.0.1, 192.168.1.1, 192.168.254.254

Then it would return all of them.