A question, because I don't know, but couldn't the following also work? (again, if 1 IP per line)
cat file.txt | xargs ping
As I understand it, that should use each individual line of the file as an argument to separate ping commands ...
Edit: Nope, apparently it doesn't. Move along, nothing to see here