A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Spring in Action
this week in the
Java in General
How to use StringTokenizer in combination with BufferedReader
Ravi Kiran Va
Joined: Apr 18, 2009
Mar 30, 2010 02:39:18
I am reading a File using a
, the file consists of different Transactions, where each Transaction is seperated using a
Y2 word .
Please let me know how can i use
in combination with
Please share your ideas .
Thanks in advance .
Save India From Corruption - Anna Hazare.
Joined: Oct 27, 2005
Mar 30, 2010 05:12:40
, it's quite old. String.split can do almost exactly the same but is better.
There are two separate issues here:
1) read a file line by line. Check out
, it has a nice method for that.
2) splitting each line. That's where String.split comes in.
I'm sure that if you get these both working separately you can combine them. Hint: the splitting goes into the reading loop
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions
How To Answer Questions
Joined: Mar 09, 2010
Mar 30, 2010 05:40:26
you can use
split() method easily with
if you dont have any newline characters in your file.
It is sorta covered in the
JavaRanch Style Guide
subject: How to use StringTokenizer in combination with BufferedReader
Flat File Search
reading passwords and connections from a flat file
Re: FileWriter write operation
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014