CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [BillKSmith] Sorting data: Edit Log



Akotb
Novice

Sep 7, 2016, 9:30 AM


Views: 10950
Re: [BillKSmith] Sorting data


In Reply To
There are several problems with your sort.

The sort function only sorts arrays, not files.


Thank you for your code, it works, but it works wrong.

the program displays the following information:

Code
  
lap name current time lap time
1{1000005} 153.847 153.847

2{1000005} 157.335 3.488




lap name current time lap time
1{1000006} 157.398 157.398

2{1000006} 298.359 140.961

3{1000006} 419.664 121.305

4{1000006} 535.539 115.875

5{1000006} 982.847 447.308


My code displays the results for each pilot:

The results of the pilot 1
circle time, the current time
1 | 153,847
2 | 3.488

The results of the pilot 2
circle time, the current time
1 | 157,398
2 | 140,961
3 | 121,305
4 | 115,875
5 | 447,308

And I would like to see the results of all pilots were recorded in a single list, and displays only the most recent result. And the program will sort the list by the winners -> the maximum number of laps + minimum amount of time for the current lap.
This means that the results of the available data, the program will display the following information:

Place | Name | Current time | Laps
1 | Pilot 2 | 447,308 | 5
2 | Pilot 1 | 3,488 | 2

The program analyzes the data file, the file is constantly updated. When new information is in the file. a list of pilots is rebuilt accordingly.

I hope I'm clearly explained,
I am confused in these moments.


(This post was edited by Akotb on Sep 7, 2016, 9:32 AM)


Edit Log:
Post edited by Akotb (Novice) on Sep 7, 2016, 9:32 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives