Tokenizer with data validation for missing text
I'm working on a project where we have to import a file to an array. The file has country, city, region, region number, and population.
I got the constructor and tokenizer to work but it also needs to do exception handling. For example, if population was blank it wouldn't try to create an object with that line.
My question is can I even use tokenizer in this case or will I need to rewrite it to use substring? I didn't think about it when I started but if the tokenizer looks for blank space then it will be trying to parse the word after the blank space (it has crashed every time I tried to input a file missing something).