aspose file tools
The moose likes I/O and Streams and the fly likes StreamTokenizer 'word' tokens Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Reply Bookmark "StreamTokenizer Watch "StreamTokenizer New topic
Author

StreamTokenizer 'word' tokens

Daniel Walker
Greenhorn

Joined: Aug 09, 2001
Posts: 19
Hi there. I am using a StreamTokenizer to parse a data file, containing multiple entries which look like this:

Things are working OK, until I get to any entry which has it's value spread over multiple lines. The StreamTokenizer will tokenize from a quote character (") to either another quote character or an end of line - and this is the problem. I have tried removing any newline characters from the source document in a preprocessing stage, but this did not work too well. Any ideas?


<B>daniel.walker</B><BR><I>***bleed in your own light...<BR>...dream of your own life...***</I>
Dale DeMott
Ranch Hand

Joined: Nov 02, 2000
Posts: 512
Are you reading in 1 line at a time? What are you removing from your string?? is it \n or \r??
-Dale


By failing to prepare, you are preparing to fail.<br />Benjamin Franklin (1706 - 1790)
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18652
Try setting eolIsSignificant(false).


"I'm not back." - Bill Harding, Twister
 
 
subject: StreamTokenizer 'word' tokens
 
Threads others viewed
Data structure help
problem StreamTokenizer??
tokenizer
StreamTokenizer
StreamTokenizer
MyEclipse, The Clear Choice