Hazel Rule for Hertz Receipts
Posted onThis article is a specific implementation of the concepts discussed in Hazel for Expense Receipts.
This rule sorts an emailed receipt from Hertz Rent-A-Car into a folder named for the year and month of the last day of the rental.
These are the details:
We just check that the document is from Hertz, and then try to pick out the correct date.
We have to look for a date (in the pattern below) that follows the word "Date", a colon, and some amount of other text. The first occurrance in the file is used, because this is the date that the receipt was generated (which is always the last day of the rental).
The pattern for this match, which is named to reflect what it matches. So two-digit month (zero padded), one digit day (no padding), four digit year -- all separated by slashes.
This just shows that you can reference the matched text from the "match" area in the "action" area.
Here we can see that the date pattern has been altered for use -- it's been re-ordered, and the day has been removed.