I used Tokenizer to split a text file which was separated like so:
FIRST NAME, MIDDLE NAME, LAST NAME
harry, rob, park
tom,,do
while (File.hasNext())
{
StringTokenizer strTokenizer = new StringTokenizer(File.nextLine(), ",");
while (strTokenizer.hasMoreTokens())
{
I have used this method to split it.
The problem is that when there is missing data (for example Tom does not have a middle name) it will ignore the split (,) and register the next value as the middle name.
How do I get it to register it as blank instead?