Hazel Date Matching for ADP Paystub

Hi All. I’m at a little bit of an impasse in creating a Hazel rule. I file my paystubs by pay date and then company name and am trying to automate the filing. The problem I have is with my pay stubs from ADP. The stub lists three dates: Period Beginning, Period Ending, and Pay Date. The issue is that Hazel’s content matching reads the text label for the dates sequentially and then the dates sequentially.

All that to say, this section of the paystub:

Is read by the content matching as:
Period Beginning: Period Ending: Pay Date: 09/19/2022 10/02/2022 10/07/2022

I of course want the last date in that three-date string to file the pdf. But the custom date matcher is taking the pay date text label and associating it with the period beginning date.

Any advice?

Could you please also post a screen shot of your Hazel Rules and I can compare with how I do same.

I had similar trouble. Finally I got it to work matching token 12/31/1999 as first from the end so it watched for the separate date at the bottom of the slip.

Having not seen yours, here is how I handle an incoming payslip. It arrives in email as a PDF file. I save the PDF attachment to the “Scanner Output” folder which is watched by Hazel. Amongst many other rules, here is the rule which handles the payslip. Pretty self explanatory I would guess.

The Noodlesoft forum is pretty good about this sort of stuff. Years ago when I started using Hazel, help there was a great assistance for the more sophisticated stuff I now have been able to accomplish.

I have had similar issues with processing content with Hazel. The problem lies not with Hazel per se, but rather with the way the data is laid out in the PDF.

One relatively easy solution is that since the dates should always appear in the same order (unless ADP changes their PDF generation process), you can just have Hazel match on dates and either match on the third occurrence or as @TheWart has suggested, the last date from the end (if there are no other dates in the pay stub).

In the image below, you will see that I have created a contents contain match condition, selected a date (which I have named “theDate”), and at the bottom of the configuration window you can see that I have asked for the third occurrence from the beginning. You could make this the first occurrence from the end as noted if that would also work based on the PDF contents.

1 Like

Your approach can work, but what I do is configure Hazel to look for the specific date I want based on the match statement which is the date after the words “Payment Date”, followed by any number of spaces, then I take the date and put it into PaymentDate field to be reused for renaming the files. Up to the OP to decide how to do this. Having not seen the rules the OP uses, I’m not sure what was done to cause the post.

Adjusting to 3rd from the beginning did the trick. Thanks for the info!