Page 1 of 1

need assistance is automating change of existing naming conv

PostPosted: Sat Jul 14, 2012 3:38 am
by luponero
hi team,

i'm a noob here and a noob with hazel. i have a question about automating a file naming convention.

i currently use the following naming convention: yymmdd example.pdf and i want to change it ot yyyy-mm-dd example.pdf

can anyone assist with a "recipe" for this? I need to keep the part of the file name that is after the date and this is obviously different for each file as it pertains to keyword information regarding the file.

any assistance would be really appreciated.

thanks - luponero

Re: need assistance is automating change of existing naming

PostPosted: Sat Jul 14, 2012 2:52 pm
by a_freyer
Assuming that all of these documents are from the 2000s, we can do this easily with filename matching. You can search the forum for detailed tutorials for this, but I'll give you the basics here:

(1) Add a rule for Name
(2) Select 'Matches'
(3) Drag a (custom token •) to the input box.
(4) Name the custom token in the new input box
(5) Add appropriate patterns in order to match the component of the file you want to recognize
(6) Create additional custom tokens, and place them next to each other, each matching a different part of the filename.
(7) Add a rename action
(8) Use your custom tokens to rename the files.


So for you:

Code: Select all
YYMMDD Example.pdf

Would match like this:

Code: Select all
(custom year token•)(custom month token•)(custom day token•) (custom filename token•)

custom year token• =(1)(1) [digit]
custom month token• = (1)(1) [digit]
custom day token• =(1)(1) [digit]
custom filename token• = (...) [anything]


Although Hazel can do this perfectly fine, if you're looking to do this only once a batch file renaming program might be better. I use Name Mangler.

However, if you constantly receive files in this format and ALWAYS want to reformat the filename, then absolutely Hazel is the tool for you.