Friday, 30 August 2013

StreamTokenizer.TT_Number reading

StreamTokenizer.TT_Number reading

I am trying to parse a file holding numbers separated by commas using
StreamTokenizer. The white spaces are commas. I would like to parse the
tokens to make sure that they are numbers not words. I have looked at
this:how to end streamtokenizer loop when reading tokens? and I think my
problem is in the white paces.
I have tried both
inputTokenizer.ttype == inputTokenizer.TT_NUMBER
and
token4 == inputTokenizer.TT_NUMBER
where
token4 = Input tokenizer.nextToken()
both return false errors
Can someone tell me fundamental error I'm making.
Thanks

No comments:

Post a Comment