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

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

Moderator: Mr_Noodle

How to handle dates written in text like "march"? 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
eco
 
Posts: 9
Joined: Wed Jun 01, 2016 8:18 am

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>>
...
Mr_Noodle
Site Admin
 
Posts: 11230
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks for the tip! I'll work on it and see if I can make generic rules for other documents.
eco
 
Posts: 9
Joined: Wed Jun 01, 2016 8:18 am


Return to Support