Page 1 of 1

Match the correct one of multiple dates in PDF

PostPosted: Sun Apr 12, 2020 11:07 am
by JuSchu
Hello!

I am trying to extract the correct date from a PDF file. But there are several dates in it. Since the files are often read by OCR, Hazel does not "read" the files from top to bottom and with the function "match the x occurence..." I often cannot find the correct date.
I would like to filter the correct date with the rule "Date last matched" "is in the last x week".
unfortunately I am not successful with this. Can this rule even filter OCR-read dates?

Thanks for your help!

Re: Match the correct one of multiple dates in PDF

PostPosted: Mon Apr 13, 2020 9:02 am
by Mr_Noodle
Note that Hazel does not control the order of the text and because of the nature of PDF, there's no guarantee the text appears in any order that is sensible.

Check the preview and see if there's surrounding text you can use in your pattern. If not, see if the date is consistent in terms of the number of the occurrence (e.g. it's always the 3rd date).

Re: Match the correct one of multiple dates in PDF

PostPosted: Mon Apr 13, 2020 9:23 am
by JuSchu
I found a solution that suits me better:

Image

Image

Image

This aims at just received documents e.g. scanned mail, recent invoices etc.
It does not help a lot for importing and renaming old documents.