File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes breaking up a file that has a delimiter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "breaking up a file that has a delimiter" Watch "breaking up a file that has a delimiter" New topic
Author

breaking up a file that has a delimiter

roy williams
Greenhorn

Joined: Mar 13, 2003
Posts: 10
I have a file that has three messages in it. the messages are separated by *** I would like to go into the file and read the bytes and when it gets to a *** stop and write that message to a different file then go until the next *** and write that to file and so on..
can anyone help explain what I should use? a snippet etc?
thanks a million!
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
roy williams
Greenhorn

Joined: Mar 13, 2003
Posts: 10
thanks alot.
Are you saying read the entire file and turn it into a string then use this tokeniizer??
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Yup. It's not the only way to do this, but it's probably the easiest (unless the file is really long and memory usage is a problem).


"I'm not back." - Bill Harding, Twister
roy williams
Greenhorn

Joined: Mar 13, 2003
Posts: 10
I will give it a try. Thank you very much for your replies.
have a great day!
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
hi Roy
if u want to use little complex thing then u can try StreamTokenizer as well...
regards
maulin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: breaking up a file that has a delimiter
 
Similar Threads
How to write Fault message in WSDL file
Is there Generic way to write a LogMessages in a flat file?
JMS and MQ
object problem
log4j: how to redirect log messages to different appenders