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

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

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
ssheth
 
Posts: 2
Joined: Sat Aug 19, 2017 5:11 am

Can you post the rule you have currently?
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Sure, here it is:
Image
ssheth
 
Posts: 2
Joined: Sat Aug 19, 2017 5:11 am

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.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support