Re: read doubles from file
- From: "hiwa" <HGA03630@xxxxxxxxxxx>
- Date: 3 Nov 2006 02:31:08 -0800
Cri wrote:
HiYou have used BufferedWriter. So they should be all strings.
I have a file that contains 3 lines like that:
X=[-1.0 -0.95315 0.783145 0.568942......]
Y=[-1.0 -1.0 0.783145 0.568942......]
Z=[-0.45315 0.233145 0.94234......]
I have to read it y store the data in 3 arrays. The file is created
using the BufferedWriter class, but to read it BufferedReader reads
lines so I can't use it because I had one String for each line, and I
don't know how to separate each double in String in components.
Also I have tried to use the DataInputStream class that has a readDouble
function but it doesn't work.
What can I do?
Thank you very much
Then, you have to use BuffereReader.readLine() for inputting
each line of string. Parse each line using regular expression.
Show us a detailed example of lines in your next post. I could
show an example parsing code. Add description for your
parsing requirement.
.
- Prev by Date: Re: Use Case... advocacy
- Next by Date: Re: AWT CHOICE old value ?
- Previous by thread: type parameter X is not within its bound
- Next by thread: Re: read doubles from file
- Index(es):
Relevant Pages
|