You need to print out the full text of the String that is read BEFORE breaking it into tokens with the Scanner class methods so you can see what line is causing the problem.