• Post Reply Bookmark Topic Watch Topic
  • New Topic

Array problem  RSS feed

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
..............................................................
 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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();"
 
Marshal
Posts: 56610
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!