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, 10:45 PM


Views: 11453
Re: [BillKSmith] Sorting data

Well, I'll explain as detailed as possible.
As you rightly pointed out - I need a program to analyze race data in real time.
You are right also the destination file. The file from which I read out the data is updated as a log file. At that momeent while the program that creates a log file and fills it, my program reading data from it without any problem, and builds a list of OUTPUT.txt.

During the race, i want to display all contestants in the order that they are currently running (order by winner). For each contestant, i should display their name, current position, and the time it took them to complete the most recent lap, and also the number of current lap.
For example Output.txt:

1 | Jon Snow | 100.125 | 5
2 | Samwell Tarly | 90.101 | 4
3 | Peter Dinklage | 97.154 | 4

As can be seen from the example - the greater the number of laps, the faster pilot. And the less time lap - the faster pilot. Thus working double SORT: by the number of laps and the last lap time.

After the race is over, i dont need a different display.
All output data of the program I need online. To make this information available on the website. To each spectator could see information from phone browser. Thus the displayed information I want to send to the Internet in two ways.

The first - a summary of all the pilots (sort by winner):
1 | Jon Snow | 100.125 | 5
2 | Samwell Tarly | 90.101 | 4
3 | Peter Dinklage | 97.154 | 4

Second - detailed information about the passage of a certain pilot of all his lap:

Results of Jon Snow
1 | 85.135
2 | 88.110
3 | 90.115
4 | 85.462
5 | 100.125

Results of Samwell Tarly
1 | 90.135
2 | 93.110
3 | 95.115
4 | 90.101

Results of Peter Dinklage
1 | 95.135
2 | 98.110
3 | 99.115
4 | 97.154

Now, the program performs only the second part of the output information - detailed information on the passage of a certain pilot of all his laps. A first part of the output information is not working. Please help how to implement it?

About the data i have posted. It is not real competitions, its just testing file. So there are no any real lap times, just test values of time, rough-and-ready, to check the efficiency of the program.

I attached to the post two files - the first file is a file with the input data (INPUT.txt and INPUT1.txt). The second file - a file matching the ID number and name of the pilot (Names.txt).


(This post was edited by Akotb on Sep 12, 2016, 12:20 PM)
Attachments: Names.txt (65 B)


Edit Log:
Post edited by Akotb (Novice) on Sep 7, 2016, 10:51 PM
Post edited by Akotb (Novice) on Sep 12, 2016, 12:20 PM


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

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