When reading data from text files, you often need to take particular actions at the end of each line or page. You certainly need to recognise when the end of data has been reached and it is time to stop reading.
Thus you need to look out for the special characters that represent end_of_line, end_of_page, and end_of_file.
TEXT_IO includes functions to check file position.
Examples:
if END_OF_PAGE (infile) then ... while not END_OF_FILE loop ...
Standard pieces of code can be written using these file position functions, to recognise the text file structure and process the data appropriately.
The appropriate code depends on how you view the data:
Here we show you how to write code to read and process: