Jump to content

[SOLVED] Loggin Activity With Dump


Crew-Portal

Recommended Posts

Okay I got MSFSFSHost which is a program that logs flights and hosts multiplayer. Now at thye end of a flight no matter who's it is it makes a file on my comp which looks like:

 

# Date  Time      Aircraft                             Near         Alt.  Hdg.    Speed   Status         
# ----  --------  -----------------------------------  ---------  ------  ----  --------  ---------------
071101  20:13:11                                                                          Flight Plan auto-opened: bell 205/KSEA-34L-KSEA/3,500ft/autorotations/LOG (Current status: On ground)
071101  20:13:15  Bell 205A-1 Stratford Helicopters v  KSEA         433'  317°     0 kts  On ground
071101  20:15:36  Bell 205A-1 Stratford Helicopters v  KSEA         434'  318°     2 kts  On ground
071101  20:15:41  Bell 205A-1 Stratford Helicopters v  KSEA         575'  325°    26 kts  On ground
071101  20:15:46  Bell 205A-1 Stratford Helicopters v  KSEA         720'  332°    40 kts  On ground
071101  20:15:51  Bell 205A-1 Stratford Helicopters v  KSEA         894'  340°    52 kts  On ground
071101  20:15:56  Bell 205A-1 Stratford Helicopters v  KSEA        1082'  341°    61 kts  Flying
071101  20:16:01  Bell 205A-1 Stratford Helicopters v  KSEA        1311'  339°    65 kts  Flying
071101  20:16:06  Bell 205A-1 Stratford Helicopters v  KSEA        1548'  334°    65 kts  Flying
071101  20:16:11  Bell 205A-1 Stratford Helicopters v  KSEA        1815'  317°    66 kts  Flying
071101  20:16:16  Bell 205A-1 Stratford Helicopters v  KSEA        2075'  297°    70 kts  Flying
071101  20:16:21  Bell 205A-1 Stratford Helicopters v  KSEA        2281'  258°    65 kts  Flying
071101  20:16:26  Bell 205A-1 Stratford Helicopters v  KSEA        2490'  252°    69 kts  Flying
071101  20:16:31  Bell 205A-1 Stratford Helicopters v  KSEA        2707'  247°    75 kts  Flying
071101  20:16:36  Bell 205A-1 Stratford Helicopters v  KSEA        2901'  239°    73 kts  Flying
071101  20:16:41  Bell 205A-1 Stratford Helicopters v  KSEA        3012'  176°    69 kts  Flying
071101  20:16:46  Bell 205A-1 Stratford Helicopters v  KSEA        3086'  155°    75 kts  Flying
071101  20:16:51  Bell 205A-1 Stratford Helicopters v  KSEA        3160'  172°    95 kts  Flying
071101  20:16:56  Bell 205A-1 Stratford Helicopters v  KSEA        3207'  168°   104 kts  Flying
071101  20:17:01  Bell 205A-1 Stratford Helicopters v  KSEA        3288'  167°   108 kts  Flying
071101  20:17:06  Bell 205A-1 Stratford Helicopters v  KSEA        3366'  164°   110 kts  Flying
071101  20:17:11  Bell 205A-1 Stratford Helicopters v  KSEA        3428'  163°   111 kts  Flying
071101  20:17:16  Bell 205A-1 Stratford Helicopters v  KSEA        3413'  162°   115 kts  Flying
071101  20:17:21  Bell 205A-1 Stratford Helicopters v  KSEA        3401'  163°   115 kts  Flying
071101  20:17:26  Bell 205A-1 Stratford Helicopters v  KSEA        3407'  165°   115 kts  Flying
071101  20:17:31  Bell 205A-1 Stratford Helicopters v  KSEA        3412'  162°   113 kts  Flying
071101  20:17:36  Bell 205A-1 Stratford Helicopters v  KSEA        3418'  161°   114 kts  Flying
071101  20:17:41  Bell 205A-1 Stratford Helicopters v  KSEA        3405'  162°   117 kts  Flying
071101  20:17:46  Bell 205A-1 Stratford Helicopters v  KSEA        3379'  162°   114 kts  Flying
071101  20:17:51  Bell 205A-1 Stratford Helicopters v  KSEA        3361'  157°   102 kts  Flying
071101  20:17:56  Bell 205A-1 Stratford Helicopters v  KSEA        3216'  153°    83 kts  Flying
071101  20:18:01  Bell 205A-1 Stratford Helicopters v  KSEA        3095'  088°    51 kts  Flying
071101  20:18:06  Bell 205A-1 Stratford Helicopters v  KSEA        2954'  057°    48 kts  Flying
071101  20:18:11  Bell 205A-1 Stratford Helicopters v  KSEA        2742'  095°    48 kts  Flying
071101  20:18:16  Bell 205A-1 Stratford Helicopters v  KSEA        2510'  047°    41 kts  Flying
071101  20:18:21  Bell 205A-1 Stratford Helicopters v  KSEA        2320'  115°    32 kts  Flying
071101  20:18:26  Bell 205A-1 Stratford Helicopters v  KSEA        2129'  028°    19 kts  Flying
071101  20:18:31  Bell 205A-1 Stratford Helicopters v  KSEA        1837'  088°    32 kts  Flying
071101  20:18:36  Bell 205A-1 Stratford Helicopters v  KSEA        1613'  020°    47 kts  Flying
071101  20:18:41  Bell 205A-1 Stratford Helicopters v  KSEA        1363'  006°    63 kts  Flying
071101  20:18:46  Bell 205A-1 Stratford Helicopters v  KSEA        1150'  015°    64 kts  Flying
071101  20:18:51  Bell 205A-1 Stratford Helicopters v  KSEA         885'  013°    71 kts  Flying
071101  20:18:56  Bell 205A-1 Stratford Helicopters v  KSEA         656'  357°    69 kts  Flying
071101  20:19:01  Bell 205A-1 Stratford Helicopters v  KSEA         533'  348°    62 kts  Flying
071101  20:19:06  Bell 205A-1 Stratford Helicopters v  KSEA         488'  344°    59 kts  Flying
071101  20:19:11  Bell 205A-1 Stratford Helicopters v  KSEA         460'  339°    53 kts  Flying
071101  20:19:16  Bell 205A-1 Stratford Helicopters v  KSEA         438'  339°    45 kts  Flying
071101  20:19:21  Bell 205A-1 Stratford Helicopters v  KSEA         439'  336°    31 kts  Flying
071101  20:19:26  Bell 205A-1 Stratford Helicopters v  KSEA         433'  338°    14 kts  Flying
071101  20:19:31                                                                          Flying Time: 0d 0h 3m 35s, Slew/Pause/Rate Time: 0d 0h 0m 0s
071101  20:19:31  Bell 205A-1 Stratford Helicopters v  KSEA         433'  335°     0 kts  On ground
071101  20:19:36  Bell 205A-1 Stratford Helicopters v  KSEA         434'  336°     1 kts  On ground
071101  20:19:41  Bell 205A-1 Stratford Helicopters v  KSEA         563'  333°    24 kts  On ground
071101  20:19:46  Bell 205A-1 Stratford Helicopters v  KSEA         715'  340°    43 kts  On ground
071101  20:19:51  Bell 205A-1 Stratford Helicopters v  KSEA         862'  337°    60 kts  On ground
071101  20:19:56  Bell 205A-1 Stratford Helicopters v  KSEA        1022'  335°    72 kts  Flying
071101  20:20:01  Bell 205A-1 Stratford Helicopters v  KSEA        1167'  341°    81 kts  Flying
071101  20:20:06  Bell 205A-1 Stratford Helicopters v  KSEA        1312'  338°    87 kts  Flying
071101  20:20:11  Bell 205A-1 Stratford Helicopters v  KSEA        1458'  337°    90 kts  Flying
071101  20:20:16  Bell 205A-1 Stratford Helicopters v  KSEA        1585'  337°    94 kts  Flying
071101  20:20:21  Bell 205A-1 Stratford Helicopters v  KSEA        1708'  337°    95 kts  Flying
071101  20:20:26  Bell 205A-1 Stratford Helicopters v  KSEA        1802'  338°    94 kts  Flying
071101  20:20:31  Bell 205A-1 Stratford Helicopters v  KSEA        2035'  283°    76 kts  Flying
071101  20:20:36  Bell 205A-1 Stratford Helicopters v  KSEA        2191'  247°    85 kts  Flying
071101  20:20:41  Bell 205A-1 Stratford Helicopters v  KSEA        2364'  240°    95 kts  Flying
071101  20:20:46  Bell 205A-1 Stratford Helicopters v  KSEA        2494'  208°   101 kts  Flying
071101  20:20:51  Bell 205A-1 Stratford Helicopters v  KSEA        2601'  153°    94 kts  Flying
071101  20:20:56  Bell 205A-1 Stratford Helicopters v  KSEA        2754'  147°    94 kts  Flying
071101  20:21:01  Bell 205A-1 Stratford Helicopters v  KSEA        2932'  168°   101 kts  Flying
071101  20:21:06  Bell 205A-1 Stratford Helicopters v  KSEA        3088'  166°   101 kts  Flying
071101  20:21:11  Bell 205A-1 Stratford Helicopters v  KSEA        3210'  163°    99 kts  Flying
071101  20:21:16  Bell 205A-1 Stratford Helicopters v  KSEA        3337'  163°   100 kts  Flying
071101  20:21:21  Bell 205A-1 Stratford Helicopters v  KSEA        3432'  162°   101 kts  Flying
071101  20:21:26  Bell 205A-1 Stratford Helicopters v  KSEA        3444'  165°   107 kts  Flying
071101  20:21:31  Bell 205A-1 Stratford Helicopters v  KSEA        3447'  166°   106 kts  Flying
071101  20:21:36  Bell 205A-1 Stratford Helicopters v  KSEA        3464'  160°    95 kts  Flying
071101  20:21:41  Bell 205A-1 Stratford Helicopters v  KSEA        3337'  143°    76 kts  Flying
071101  20:21:46  Bell 205A-1 Stratford Helicopters v  KSEA        3187'  068°    58 kts  Flying
071101  20:21:51  Bell 205A-1 Stratford Helicopters v  KSEA        2959'  129°    47 kts  Flying
071101  20:21:56  Bell 205A-1 Stratford Helicopters v  KSEA        2722'  024°    55 kts  Flying
071101  20:22:01  Bell 205A-1 Stratford Helicopters v  KSEA        2468'  110°    55 kts  Flying
071101  20:22:06  Bell 205A-1 Stratford Helicopters v  KSEA        2220'  054°    51 kts  Flying
071101  20:22:11  Bell 205A-1 Stratford Helicopters v  KSEA        1986'  080°    55 kts  Flying
071101  20:22:16  Bell 205A-1 Stratford Helicopters v  KSEA        1706'  120°    46 kts  Flying
071101  20:22:21  Bell 205A-1 Stratford Helicopters v  KSEA        1505'  043°    51 kts  Flying
071101  20:22:26  Bell 205A-1 Stratford Helicopters v  KSEA        1240'  346°    71 kts  Flying
071101  20:22:31  Bell 205A-1 Stratford Helicopters v  KSEA         872'  016°    77 kts  Flying
071101  20:22:36  Bell 205A-1 Stratford Helicopters v  KSEA         587'  339°    82 kts  Flying
071101  20:22:41  Bell 205A-1 Stratford Helicopters v  KSEA         474'  339°    89 kts  Flying
071101  20:22:46  Bell 205A-1 Stratford Helicopters v  KSEA         446'  344°    76 kts  Flying
071101  20:22:51  Bell 205A-1 Stratford Helicopters v  KSEA         434'  342°    69 kts  Flying
071101  20:22:56  Bell 205A-1 Stratford Helicopters v  KSEA         433'  339°    12 kts  Flying
071101  20:22:58                                                                          Flying Time: 0d 0h 3m 6s, Slew/Pause/Rate Time: 0d 0h 0m 0s
071101  20:23:01  Bell 205A-1 Stratford Helicopters v  KSEA         433'  338°     0 kts  On ground
071101  20:23:11  Bell 205A-1 Stratford Helicopters v  KSEA         433'  337°     0 kts  On ground
071101  20:23:16  Bell 205A-1 Stratford Helicopters v  KSEA         433'  335°     0 kts  On ground
071101  20:23:21  Bell 205A-1 Stratford Helicopters v  KSEA         484'  355°    19 kts  On ground
071101  20:23:26  Bell 205A-1 Stratford Helicopters v  KSEA         633'  340°    42 kts  On ground
071101  20:23:32  Bell 205A-1 Stratford Helicopters v  KSEA         823'  338°    46 kts  On ground
071101  20:23:37  Bell 205A-1 Stratford Helicopters v  KSEA        1027'  341°    53 kts  On ground
071101  20:23:42  Bell 205A-1 Stratford Helicopters v  KSEA        1306'  342°    62 kts  Flying
071101  20:23:47  Bell 205A-1 Stratford Helicopters v  KSEA        1443'  339°    66 kts  Flying
071101  20:23:52  Bell 205A-1 Stratford Helicopters v  KSEA        1691'  345°    71 kts  Flying
071101  20:23:57  Bell 205A-1 Stratford Helicopters v  KSEA        1896'  345°    68 kts  Flying
071101  20:24:02  Bell 205A-1 Stratford Helicopters v  KSEA        1760'  332°    71 kts  Flying
071101  20:24:07  Bell 205A-1 Stratford Helicopters v  KSEA        1599'  327°    70 kts  Flying
071101  20:24:12  Bell 205A-1 Stratford Helicopters v  KSEA        1461'  332°    65 kts  Flying
071101  20:24:17  Bell 205A-1 Stratford Helicopters v  KSEA        1313'  345°    56 kts  Flying
071101  20:24:22  Bell 205A-1 Stratford Helicopters v  KSEA        1134'  044°    37 kts  Flying
071101  20:24:27  Bell 205A-1 Stratford Helicopters v  KSEA        1010'  079°    37 kts  Flying
071101  20:24:32  Bell 205A-1 Stratford Helicopters v  KSEA         856'  124°    43 kts  Flying
071101  20:24:37  Bell 205A-1 Stratford Helicopters v  KSEA         728'  129°    60 kts  Flying
071101  20:24:42  Bell 205A-1 Stratford Helicopters v  KSEA         591'  133°    86 kts  Flying
071101  20:24:47  Bell 205A-1 Stratford Helicopters v  KSEA         587'  131°    80 kts  Flying
071101  20:24:52  Bell 205A-1 Stratford Helicopters v  KSEA         624'  127°    56 kts  Flying
071101  20:24:57  Bell 205A-1 Stratford Helicopters v  KSEA         635'  132°    20 kts  Flying
071101  20:25:02  Bell 205A-1 Stratford Helicopters v  KSEA         611'  138°    23 kts  Flying
071101  20:25:07  Bell 205A-1 Stratford Helicopters v  KSEA         597'  139°    45 kts  Flying
071101  20:25:12  Bell 205A-1 Stratford Helicopters v  KSEA         595'  142°    56 kts  Flying
071101  20:25:17  Bell 205A-1 Stratford Helicopters v  KSEA         601'  148°    71 kts  Flying
071101  20:25:22  Bell 205A-1 Stratford Helicopters v  KSEA         583'  147°    85 kts  Flying
071101  20:25:27  Bell 205A-1 Stratford Helicopters v  KSEA         493'  144°    84 kts  Flying
071101  20:25:32  Bell 205A-1 Stratford Helicopters v  KSEA         453'  140°    69 kts  Flying
071101  20:25:37  Bell 205A-1 Stratford Helicopters v  KSEA         448'  133°    44 kts  Flying
071101  20:25:42  Bell 205A-1 Stratford Helicopters v  KSEA         440'  140°    25 kts  Flying
071101  20:25:47  Bell 205A-1 Stratford Helicopters v  KSEA         444'  136°    37 kts  Flying
071101  20:25:52  Bell 205A-1 Stratford Helicopters v  KSEA         433'  125°    33 kts  Flying
071101  20:25:57  Bell 205A-1 Stratford Helicopters v  KSEA         433'  127°    15 kts  Flying
071101  20:26:02  Bell 205A-1 Stratford Helicopters v  KSEA         433'  128°     0 kts  Flying
071101  20:26:05                                                                          Flying Time: 0d 0h 2m 24s, Slew/Pause/Rate Time: 0d 0h 0m 0s
071101  20:26:07  Bell 205A-1 Stratford Helicopters v  KSEA         433'  128°     0 kts  On ground
071101  20:26:22  Bell 205A-1 Stratford Helicopters v  KSEA         433'  345°     0 kts  On ground
071101  20:26:27  Bell 205A-1 Stratford Helicopters v  KSEA         433'  343°     0 kts  On ground
071101  20:26:52  Bell 205A-1 Stratford Helicopters v  KSEA         434'  342°     3 kts  On ground
071101  20:26:57  Bell 205A-1 Stratford Helicopters v  KSEA         446'  341°    20 kts  On ground
071101  20:27:02  Bell 205A-1 Stratford Helicopters v  KSEA         444'  341°    33 kts  On ground
071101  20:27:07  Bell 205A-1 Stratford Helicopters v  KSEA         450'  345°    52 kts  On ground
071101  20:27:12  Bell 205A-1 Stratford Helicopters v  KSEA         443'  341°    62 kts  Flying
071101  20:27:17  Bell 205A-1 Stratford Helicopters v  KSEA         457'  342°    70 kts  Flying
071101  20:27:22  Bell 205A-1 Stratford Helicopters v  KSEA         463'  341°    75 kts  Flying
071101  20:27:27  Bell 205A-1 Stratford Helicopters v  KSEA         447'  340°    77 kts  Flying
071101  20:27:32  Bell 205A-1 Stratford Helicopters v  KSEA         449'  341°    65 kts  Flying
071101  20:27:37  Bell 205A-1 Stratford Helicopters v  KSEA         444'  342°    49 kts  Flying
071101  20:27:42  Bell 205A-1 Stratford Helicopters v  KSEA         446'  351°    34 kts  Flying
071101  20:27:47  Bell 205A-1 Stratford Helicopters v  KSEA         436'  353°    34 kts  Flying
071101  20:27:52  Bell 205A-1 Stratford Helicopters v  KSEA         446'  353°    33 kts  Flying
071101  20:27:57  Bell 205A-1 Stratford Helicopters v  KSEA         454'  354°    26 kts  Flying
071101  20:28:02  Bell 205A-1 Stratford Helicopters v  KSEA         452'  002°    21 kts  Flying
071101  20:28:07  Bell 205A-1 Stratford Helicopters v  KSEA         449'  019°    19 kts  Flying
071101  20:28:12  Bell 205A-1 Stratford Helicopters v  KSEA         454'  046°    18 kts  Flying
071101  20:28:17  Bell 205A-1 Stratford Helicopters v  KSEA         450'  034°    13 kts  Flying
071101  20:28:22  Bell 205A-1 Stratford Helicopters v  KSEA         446'  321°     4 kts  Flying
071101  20:28:27  Bell 205A-1 Stratford Helicopters v  KSEA         433'  264°     0 kts  Flying
071101  20:28:31                                                                          Flying Time: 0d 0h 1m 20s, Slew/Pause/Rate Time: 0d 0h 0m 0s
071101  20:28:32  Bell 205A-1 Stratford Helicopters v  KSEA         433'  251°     0 kts  On ground
071101  20:29:17  Bell 205A-1 Stratford Helicopters v  KSEA         433'  251°     0 kts  Slew/Pause/Rate
071101  20:31:21                                                                          Flight Plan closed: bell 205/KSEA-34L-KSEA/3,500ft/autorotations/LOG (Current Status: Slew/Pause/Rate, Open Time: 0d 0h 18m 10s, Flying Time: 0d 0h 10m 25s, Slew/Pause/Rate Time: 0d 0h 2m 8s, On-ground Airports: KSEA)

 

The FIle is called N784SH_071101_201311_bell 205KSEA-34L-KSEA3,500ftautorotationsLOG.txt By the way

 

Is there any way for a PHP script to take that data And put it into a mySQL database when I click a button like Validate or somethin? So it enters the username, flight id, and all that stuff, or am I going to need to use an XML dump or somethin?

Link to comment
Share on other sites

it can be done, but why do it manually use a cron job to do it, I'll lay it out for you

 

1) Use glob on the folder where the logs are stored

2) based on the results of 1 figure out which logs are not in sql

3) use a foreach loop on the logs Not in sql to open them

4) while in the loop in 3 explode the file at the \n then explode each of those at the \t (the tabs)

5) now you can recall it very easily and insert all the rows into sql with a query

 

that is the basic of it, its a bit more complicated then it sounds, but can be done.  You might want to use a enum() field in SQL for the status types to save space, but otherwise it ain't terrible.  Look up the following functions to get you going

 

Glob, Foreach, While, File_get_contents, Explode and you will find it is pretty straight forward just a lotta grinding through it

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.