What's the best way to read a text file line by line?

line input is fine for reading the data but how to do you
continue to the next line and stop at the end