Problem with StreamTokenizer
Posted on 2001-07-31
I am reading a .csv file(comma separated) using stream tokenizer. My file is as the following:
I am reading it line by line and separating each line into tokens separated by comma.
If the file is in the above format I am not having any problem in reading.
If the file is in the following format:
i.e if the double quotes are removed from the String having spaces
I am having the problem. My program is taking "Ivanesevich" as one token and "wins" as another token whereas i want "Ivanesevich Wins" as a single token.
I am using the StreamTokenizer. My code goes as follows:
where st is the streamtokenizer.
How to avoid this problem?
If would be helpful if you can post some sample code.