Forums Register Login

Array problem

+Pie Number of slices to send: Send
This program are ok ........ but i need extract the

(program exit.)
driver:1 time: 1:35:37:950
driver:2 time: 1:36:12:42
driver:11 time: 1:37:2:133
driver:16 time: 1:36:43:796
driver:7 time: 1:35:22:453
driver:9 time: 1:36:23:23
driver:15 time: 1:36:24:964
driver:5 time: 1:36:9:692
driver:10 time: 1:36:40:380
driver:4 time: 1:35:32:339
driver:6 time: 1:36:54:567
driver:8 time: 1:37:5:56
------------------------------------------------------------
I need extract the datos [0] in a array of drivers.
and extract datos [1,2,3,4] in a array of time.
and pass de datos [1,2,3,4] to miliseconds
..............................................................
+Pie Number of slices to send: Send
You know how to read the data and what to do with the data, so what is it you are stuck on?

Converting the 4 time values to milliseconds? That should be easy - it's just some multiplication and addition.
Creating arrays? Well, without know how many you'll read it, you'll need a Collection or Map.
Sorting the data?

Sorry - it's not really clear what problem you are having.

You should also consider a finally block with "in.close();"
+Pie Number of slices to send: Send
Please tell us what the thread is about in its subject; "next problem" is not helpful.

Please check the conventions for class names; you will suffer no end of confusion between "lee" and "lee".
You cannot put the names into an array until you know how many members there are for this array. You may need to read all the lines, and count them. You might be able to take the BufferedReader back to the beginning of the file with the mark() and reset() methods, but I have never tried them.
Beware: you are not closing your BufferedReader anywhere. The BufferedReader ought to be declared as a local variable.
And don't put file-reading code into the constructor of that class.
I am mighty! And this is a mighty small ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 716 times.
Similar Threads
string extraction by giving position as first argument in command prompt
i cant ...... learn to use the split
doubt from scjp book on threads
exercise getServiceByName
IPC through streams
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:47:22.