Page 1 of 1

How to handle dates written in text like "march"?

PostPosted: Mon Apr 01, 2019 6:20 pm
by eco
Hi,
I am not sure this is still in the scope of what Hazel does. I have documents where the date is written as follows:

Code: Select all
DATE: 21 march 2019


I am looking for a way to name the file based on such a date. Something along the lines of

Code: Select all
[...]
If contents contain match "march 2019", then variable = 3
If contents contain match "february 2019", then variable = 2
[...]


Then I of course use the variable to name the file.

Can this be done? If not, has anyone done this another way? I work with PDF files only. OCRwed of course! ;)

Thanks for any help/advice.
eco

Re: How to handle dates written in text like "march"?

PostPosted: Tue Apr 02, 2019 9:40 am
by Mr_Noodle
You can't set variables like that but you can have separate rules with conditions like:
Code: Select all
If
    Contents contain match •some custom date attribute
    •some custom date attribute occurs on <<march 2019>>
...

Re: How to handle dates written in text like "march"?

PostPosted: Tue Apr 02, 2019 3:04 pm
by eco
Thanks for the tip! I'll work on it and see if I can make generic rules for other documents.