BreakIterator vs. StringTokenizer for delimited file with null values
Hi! I am working with a delimited file that contains null values (looking like ,,). I am using the String
Tokenizer which works fine as long as there are no null values. Once it hits a null, it just skips right over the nulls (not counting it as a token), and causes and Exception to be thrown at the end due to the .nextToken() method not finding the correct amount of tokens.
For example, if the delimited file is:
Number1,Number2,,Number3
If I use the nextToken() method, if will print:
Number1
Number2
Number3
Exception thrown as can't find right number of tokens
I have tried to use the BreakIterator.getWordInstance() however the commas still print out - Which is exactly what the StringTokenizer does when the bReturnTokens = true. I have seen a lot of forums on customizing the StringTokenizer, but I am wondering if there is a way to use the BreakIterator class for this?
Thanks for the help!

