Here is one way of reading a file row after row:
String pathToFile = filename; //filename to read in
String recordHolder; //holds line of data
File in = new File(filename);
try {
BufferedReader InFile = new BufferedReader( new
FileReader(in) );
//get record from input file
while(( recordHolder = InFile.readLine() ) != null)
{
//put your code here
}
InFile.close();
} catch(IOException ioe){//error code here }