The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
December 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Reading IP addresses from a file using the StreamTokenizer

Posted by Yaron Berman on December 11, 2000 at 9:30 AM

Hello,

I want to use the StreamTokenizer to read a file that has IP addresses in it (the format xxx.xxx.xxx.xxx).
The tokenizer reads these strings as numbers, for example:
10.10.10.2
is read as
10.1
0.1
0.2

Actually all I want is to read all non-whitespace chars as words.
I tried to use the wordChars() but it didn't help.

Can anyone help me please?

Thanks,
Yaron



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us