Struggling with Date Codes

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

Moderator: Mr_Noodle

Struggling with Date Codes Fri Jan 03, 2020 7:47 pm • by OogieM
No matter what I try I cannot get Hazel to pick out the correct dates in certain PDF statements.

My rules start first with text that is in the name of the file I download
full name contains then the text that is in the filename
Then I try to add a date code using contents contain match.
The date in the PDF is formatted like this
"Statement Period Nov 30 - Dec 31, 2019"
That is the first place a date appears in the PDF. However, later in the file there are dates like this
Tax Statements by Feb. 15,
12/04
08/02/1997

Once an item matches I want to rename it with a different date pattern 1999,-,12,-,31_then text and move the file to a folder for that entity's statements. In the example above the date Hazel should pull out is Dec 31, 2019 and then reformat to 2019-12-31

Things I have tried to get the date to be found included setting the date string to be "Statement Period" then anything then - then the date in format Dec, year and set for the first instance. I get errors that it does not match. No matter what I do I cannot find a set of parameters that match the date properly by trying to add in the text it should look for to ensure it gets the correct date.

If I set it to finding the date automatically with the date token as the only thing I am trying to match then it always gets the 08/02/1997 date and renames the files to that incorrect date.

If I try to count from the end and thus skipping the 1997 date it gets the date as November 30 not the December date

Help hasn't been particularly helpful since according to the date matching sections I should be getting the correct date.

Where do I go from here to get this working?
OogieM
 
Posts: 2
Joined: Fri Jan 03, 2020 7:21 pm

Re: Struggling with Date Codes Mon Jan 06, 2020 11:31 am • by Mr_Noodle
Can you include screenshots of the date patterns you are using? Also, are these PDF documents OCRed or are they digitally generated?
Mr_Noodle
Site Admin
 
Posts: 11196
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Struggling with Date Codes Mon Jan 06, 2020 12:00 pm • by OogieM
I'd be glad to but can't figure out how to insert a screen shot into the message. No matter what I try it just comes in as a link to the file on my system which won't work since it's not open for reading from outside the network.

And as to the type of PDF. It's whatever the financial company creates. I don't do anything special to it in terms of OCR.

The rules used to work, as in several months ago but have stopped. I haven't changed anything and the appearance of the PDFs is the same too.
Last edited by OogieM on Mon Jan 06, 2020 12:01 pm, edited 1 time in total.
OogieM
 
Posts: 2
Joined: Fri Jan 03, 2020 7:21 pm

Re: Struggling with Date Codes Mon Jan 06, 2020 12:01 pm • by Mr_Noodle
Sorry, forgot to mention that you need to host the images on another site. Many cloud services have them but if you don't use those, try imgur.com.
Mr_Noodle
Site Admin
 
Posts: 11196
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron