| Author |
File I/O
|
Sasikanth Malladi
Ranch Hand
Joined: Nov 04, 2000
Posts: 175
|
|
Hi! I've got a .txt file with eight lines. Each line contains integers separated by commas. I want to read these numbers. What's the best way of doing it? FileInputStream seems to be pretty unfriendly for this application. Thanks, Sasikanth
|
 |
Peter Tran
Bartender
Joined: Jan 02, 2001
Posts: 783
|
|
Use a Reader so you can use a readLine. Pass the String object to a StringTokenizer to get each number. -Peter
|
 |
Sasikanth Malladi
Ranch Hand
Joined: Nov 04, 2000
Posts: 175
|
|
Peter, Thanks for your reply. But which reader? Sasikanth
|
 |
Peter Tran
Bartender
Joined: Jan 02, 2001
Posts: 783
|
|
Use a FileReader chained to a BufferedReader. E.g. And use in.readLine(). -Peter
|
 |
 |
|
|
subject: File I/O
|
|
|