Change date match (month) digit from one to two digits

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

Moderator: Mr_Noodle

Hello,

I like to know, if it's possible to change a date match from one digit to two digits for the renaming of files?

Example: I have files with the dates in the content like 28.2.2016. I can match the content with date token. For the month I use a one digit token. Now I like to use the matched month and the year to rename the file to: "2016-02_bla-bla-bla.pdf". In the moment, the renamed file is "2016-2_bla-bla-bla.pdf", that means the month in the file name comes from the one digit ("2") match, but I like to change this token to "02" (If I use the two digit date token for the month, then the match - as expected - doesn't work).
Last edited by Tätä on Fri Mar 04, 2016 11:55 am, edited 1 time in total.
Tätä
 
Posts: 7
Joined: Fri Mar 04, 2016 6:45 am

You can use different month tokens between the match pattern and rename pattern. In the match pattern, you can use the normal month token to catch both single and double-digit months. In the rename action. In the rename pattern, you can specify two digits months. They are totally independent from one another.
Mr_Noodle
Site Admin
 
Posts: 11875
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thank you very much!

It's working fine.
Yesterday - before I asked my question in the forum - I have tried with the same approach, but without success, so I asked my question. I suggest that a restart would have solved the problem. I think that hazel needs a refresh when one insert a lot of rules or change a lot of rules, could this be?
Tätä
 
Posts: 7
Joined: Fri Mar 04, 2016 6:45 am

It shouldn't but maybe things were in an odd state at the time.
Mr_Noodle
Site Admin
 
Posts: 11875
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron