Jump to content

Getting my head around an Ical/.ICS conversion idea.


kiwigirl

Recommended Posts

Hey everyone, have taken a bit of a break (a couple of years) from all things PHP and generally web related, but now a project has popped up that I am really interested in figuring out. I am so, so sorry if this ends up being a very long and confusing post, but I am really hoping somebody out there might have some experience in doing this sort of thing, or maybe it is just MUCH simpler than I have convinced myself of, and I am making things unnecessarily hard for myself.

 

First of all, I am not sure if this is as much of a coding question, or if I am just not managing to sort out the logic of it all in my head, but for some reason I just cant figure out where to get started.

 

I am not looking for someone to tell me what to write per say, but just any advice at all that can head me in the right direction.

 

Anyhow, here goes.. I have an automatically generated roster file, created by sabre airline solutions, that is automatically emailed out to all employees of the airline. It is a 28 day roster, and I am wanting to write a script of some sort that will automatically convert it into an ICS or Ical file for further integration with things I am doing.  I have done a lot of reading about the formats of ics files, and I understand how they work, it is just writing something that will interpret the initial roster correctly that is stumping me, once I get the information out of it in a logical way, I think I can easily turn it into an ics. I was heading down the array pathway before, but I just keep getting to dead ends and methods that just arent practical. Here is a snippit from the original roster format:

 

"31 AKL7494          LO    APW 1250  APW 1210*              -    APW  23:20  0450  0620 

01 AKL7494    0630  0091  AKL 0730  APW 1220- 03:50  24:50  73P 

  AKL7494    1210  0094  APW 1310  AKL 1615* 04:05  00:30  73P 

02 AKL7494          RST  AKL 1645  AKL 0445*              -    AKL        0405  0535  34:15  12:00 

03 AKL7506    0500  GT    AKL 0500  HLZ 0700  02:00        -       

  AKL7506          0085  HLZ 0800  BNE 0840  03:40  00:30  73P 

  AKL7506          LO    BNE 0910  BNE 0830*              -    BNE  23:20  0340  0710 

04 AKL7506    0830  0074  BNE 0930  DUD 1610  03:40  00:50  73P 

  AKL7506          0075  DUD 1700  BNE 1745  03:45  00:30  73P 

  AKL7506          LO    BNE 1815  BNE 1430*              -    BNE  20:15  0725  0945 

05 AKL7506          LO    APW 0050  APW 1210                -    APW  11:20  0725  0945 

  AKL7506    1210  0094  APW 1310  AKL 1615* 04:05  -21:-4573P 

  AKL7506    1430  0097  BNE 1530  APW 0020  04:50  17:25  73P 

06 AKL7506          RST  AKL 1645  AKL 0445*              -    AKL        0450  0620  83:45  12:00  "

 

if a little clarification is needed.. (i know I needed it when I first began recieving these rosters!) the 31, 01, 02 etc are the dates of the month, the 31 only comes up if the month before ends halfway through a trip where the person is still away for work when the month turns over.

the AKL,APW,BNE etc are airport/location codes, LO is layover (eg spending the night there) the other various times are departure times, arrival times (all in local time to wherever the person happens to be at the time) and also flight times, total duty times.  The airport codes with numbers (eg AKL7506) is the trip code, meaning for that whole period you will be with the same crew, and away from your home port/base.

 

The first problem I have encountered, is it is not consistent, some days will have 1 line, but layovers will take up one or two or more lines, so I cannot just separate the entries via line, i guess it has to be started wherever a numerical/date value begins the line? Also how do i split the data, based on white space in between (if that makes sense)

 

I hope maybe this makes a little sense to someone, I know somebody has managed to write exactly what I am trying to do, for the exact same roster system, but for a different purpose, but I have had no luck getting in touch with this person.

 

Thanks so much to anyone who can shed any light on this situation,

 

Anna

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.