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 Convert to BufferedReader & StringTokenizor... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Convert to BufferedReader & StringTokenizor..." Watch "Convert to BufferedReader & StringTokenizor..." New topic
Author

Convert to BufferedReader & StringTokenizor...

Rob James
Greenhorn

Joined: Jun 06, 2004
Posts: 15
Hi,

I'm trying to convert the file below to utilize BufferedReader & SringTokenizor.... the exact instructions in my textbook were..

"so that it reads a line as a string in a BufferedReader stream, and then uses StringTokenizor to extract the fields"

I'm having a bit of trouble getting it to go... I've tried to reference a few examples and I thought I was onto it but I must have messed up something.

As you can see I commented out the code that was there and I inserted some lines of code tagged as //added or //editted... its erroring on this line way at the bottom.....

if (infile != null) infile.close();//editted

Does anyone know what I did wrong or if I am thusfar on the right track?? (I think I am, I think)........ any comments/suggestions/help/or references would be appreciated. Thank you.



[ June 14, 2004: Message edited by: Rob James ]
Marco Antonio
Greenhorn

Joined: Jun 15, 2004
Posts: 1
Try this working code if you need a StringTokenizer. I suppose StreamTokenizer was a typo?

Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

moving this to the intermediate forum.

Please be careful that you don't do someone's homework for them out-right -- offer suggestions and pointers, and point out mistakes, but don't just code it for them. Thanks!
 
 
subject: Convert to BufferedReader & StringTokenizor...
 
Similar Threads
StringTokenizer
Help. Recognising white space in a string
Reference Specific Line in Text File
Getting variables from Outfiles
Tokens