Page 1 of 1

File e-tickets with PNR, airport code and date of travel

PostPosted: Sat Aug 19, 2017 5:29 am
by ssheth
I need help with saving e-tickets for my flights, which I receive in a PDF format with the following scheme:

date_to-date_return-dep-des-PNR.pdf where
date_to: departure date (in YYYY-MM-DD)
date_return: return date (in YYYY-MM-DD)
dep: 3 letter airport code of departure airport
des: 3 letter airport code of arrival airport
PNR: Alphanumeric code of length = 6

I have managed to set this up for a journey that only has one destination say - BOS-JFK, but I can't figure out how to get it to handle tickets with multiple stops say BOS-CLT-LGA-ORD

As you can see, I've managed to name the file, but it isn't accurate.
The top portion of what I get from the airline can be found here on DropBox: https://www.dropbox.com/s/uoz3mf5mrbyo6o3/2017-08-24-2017-08-24-BDQ-BOM-BOM-HMJVWQ.pdf?dl=0

Re: File e-tickets with PNR, airport code and date of travel

PostPosted: Mon Aug 21, 2017 10:44 am
by Mr_Noodle
Can you post the rule you have currently?

Re: File e-tickets with PNR, airport code and date of travel

PostPosted: Tue Aug 22, 2017 4:21 am
by ssheth
Sure, here it is:
Image

Re: File e-tickets with PNR, airport code and date of travel

PostPosted: Tue Aug 22, 2017 10:46 am
by Mr_Noodle
I don't think this will work as you have everything in separate conditions. I suspect dep-leg and dep-leg2 will match the same thing, as will "to", "from" and "to-2". There is no context to tell them apart.

Use Hazel's preview feature. Using that, you can see the text as Hazel sees it. That should hopefully point out surrounding context which you can include in your pattern to more uniquely identify the parts.