Read the file a whole line at a time using something like:

// fileInput is a Scanner object on the file
String[] lineOfData = fileInput.nextLine().split( " " );

(I didn't look at your code, so...