The most straight forward thing to do is to read the file from top to bottom. Most likely you will use a BufferedReader. (There's an example of usage at java2s.com)



Consider a small child...