Rule cannot find 2nd or 3rd date

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

Moderator: Mr_Noodle

Rule cannot find 2nd or 3rd date Tue Jul 14, 2020 2:17 am • by rchrd
I've got a document (invoice) which has multiple dates in it. The first 2 dates are the billing period and the third is the billing date. I want to extract the last one to include that in the filename.

So in the document it looks like this:
Code: Select all
Billing Cycle    27-5-2020 to 26-6-2020
Invoice Date     14-7-2020


If I set the date matcher to automatic and first it matches the date 27-5-2020. But if I set it to 2nd or 3rd there is no match. Even when I set it to match the first date from the end it still matches the first one.

The preview of the rule shows this as (part of) the content:
Code: Select all
E0200AGEVZ 27-5-2020 to 26-6-2020 14-7-2020 Credit Card


Any ideas how I can extract the last date from the document.
rchrd
 
Posts: 4
Joined: Tue Jul 14, 2020 2:05 am

Re: Rule cannot find 2nd or 3rd date Tue Jul 14, 2020 10:01 am • by Mr_Noodle
I suggest specifying the date format explicitly in this case. Apple's data detectors in this case may not be able to deal with this correctly.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Rule cannot find 2nd or 3rd date Tue Jul 14, 2020 3:07 pm • by rchrd
Thanks, setting the date format fixed the problem!
rchrd
 
Posts: 4
Joined: Tue Jul 14, 2020 2:05 am

Re: Rule cannot find 2nd or 3rd date Sat Feb 20, 2021 2:03 pm • by mcginnie
I have the same problem, but this solution doesn't work. The rule (using auto date detection) used to work prior to Hazel update. When I search within the pdf for the date format, it is found, but the automatic date function is resulting in the wrong date (first date in pdf is 01/12/2021 but it detects 7/24/2024. Searched the doc to find the date it is finding but it is NOT THERE. Tried to use a defined date but Hazel does not detect it. There are multiple dates in the file, and I've tried to get it to detect 1st, 2nd, 3rd, etc. but, of course, if it's not seeing the pattern for the first instance, it's actually not detecting the pattern at all.

Any more thoughts on how to fix?
mcginnie
 
Posts: 6
Joined: Thu Aug 25, 2016 7:11 pm

Re: Rule cannot find 2nd or 3rd date Mon Feb 22, 2021 10:27 am • by Mr_Noodle
Nothing has changed with the auto date detection so I suspect something else is going on here. Can you post the date pattern you are using?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Rule cannot find 2nd or 3rd date Wed Feb 24, 2021 1:22 pm • by mcginnie
Mr_Noodle wrote:Nothing has changed with the auto date detection so I suspect something else is going on here. Can you post the date pattern you are using?


It's multiple patterns. Just happened again with another file. For a while, when downloading from web, key doc info (from multiple sites - all bills) did not seem to be OCR, so I set up a rule to open pdfpen pro and OCR them after download, then close the doc. This is working, and when I go to the doc I can copy out the date, so it's recognized, but it gets an "X" in the preview for the rule. Today's doc has both "February 12, 2021" and "02/12/2021" formats, but it won't recognize either one in the automatic date detection. AND, when I set the date pattern manually, it still doesn't find it. This has only happened since the update (I'm using version 5.0.5). Thanks.
mcginnie
 
Posts: 6
Joined: Thu Aug 25, 2016 7:11 pm

Re: Rule cannot find 2nd or 3rd date Thu Feb 25, 2021 10:22 am • by Mr_Noodle
In the preview, can you check the text of the document and post some examples of the dates from there?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Rule cannot find 2nd or 3rd date Sun Mar 07, 2021 12:16 pm • by mcginnie
Here are several examples from the item:

February 18, 2021
Date Received: February 12, 2021Date Received: February 12, 2021 Pa
February 18, 2021 Paid: February 18, 2021

I noticed in a more recent doc from the same source (these are insurance summaries), they use double digits for all day/mo dates, that is, March 01, 2021. I've tried using a manual date instead of automatic, but that's not working either. Thanks.
mcginnie
 
Posts: 6
Joined: Thu Aug 25, 2016 7:11 pm

Re: Rule cannot find 2nd or 3rd date Mon Mar 08, 2021 11:38 am • by Mr_Noodle
Can you post your date pattern?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Rule cannot find 2nd or 3rd date Wed Mar 10, 2021 10:44 am • by mcginnie
Mr_Noodle wrote:Can you post your date pattern?


Maybe I don't understand the question - I thought that is what I did in the last comment. Within Hazel I was using the automatic detection, and I also tried the "December 31, 1999". In the document the pattern is March 01, 2021. Let me know what else you need.
mcginnie
 
Posts: 6
Joined: Thu Aug 25, 2016 7:11 pm

Re: Rule cannot find 2nd or 3rd date Thu Mar 11, 2021 9:46 am • by Mr_Noodle
Sorry about that. Can you email in an example file and a copy of the rule? Make sure the example file doesn't have any personal info.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support