 <p>StringTokenizer treats consecutive delimiters as a single delimiter. You say the input contains [tab space] as delimiters, but the rest of your code doesn't seem to be expecting spaces so, without more information, I'm going to guess that the input is delimited only with tabs (not [tab space]), and the adjacent delimiters are being ignored, Then the last <code>nextToken()</code> throws an exception which you are ignoring.</p> <p>The answer here is to rewrite this using <code>split()</code>, as recommended in the <a href="http://download.oracle.com/javase/6/docs/api/java/util/StringTokenizer.html" rel="nofollow">Javadoc</a></p> <blockquote> <p>StringTokenizer is a legacy class that is retained for compatibility reasons although its use is discouraged in new code. It is recommended that anyone seeking this functionality use the split method of String or the java.util.regex package instead.</p> </blockquote> <p>That said, you should look at any of the existing CSV libraries out there (Google for Java CSV).</p>