How to create a folder after a file name and sort files in ?

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

Moderator: Mr_Noodle

Hello,

First of all, I would like to thank all the noodlesoft team for making such a powerfull software as hazel, this is a great time saver and I enjoy it everyday !

THANKS SO MUCH !

Here is what hazel does for me :

    1st rule : Look for new files in the "scanned invoices" folder, if matches the name "invoice" then transfert to "Invoice" folder

    2nd rule : Look for new files in the "Invoices" folder and rename with this pattern :
    "Image"
    and move to "Invoice sorting" folder

    3rd rule : Look for files which name contains "Invoice 11-12.2016.pdf" and move to folder "Invoices from 12.2016"

PS : I'm french so our date format is dd.mm.yyyy

These automated 3 steps are great but the drawbacks are :

    1st drawback The 3rd rule has to be written as many times as many months and years exist (I do it year by year but this is a lot of work...)
    2nd drawback The 3rd rule supposes the folder "Invoices from 12.2016" (and so on...) already exist, so I have to create all the folders once a year... (easier than creating rules but still a bit of work)


So, I tried to have a fully automated job all done by Hazel but cannot find how to automate the 3rd rule to :

Look for files which name contains "Invoice 11-12.2016.pdf"
Create a folder named "yyyy" (2016 for instance) if this folder already exists : open and create a subfolder named "12-2016" (12.2016 for instance), if this folder exists move file in it.

Can you please help me in doing so ?
Do you think I can simplify my rules ?

Best regards from Paris :D

Arnaud
arnaud
 
Posts: 8
Joined: Sun Dec 11, 2016 11:18 am

Search the help for "match patterns". You'll want to create a custom date attribute to match the date in the name. You can then re-use that custom attribute in the Sort into subfolder action.
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Hi Mr Noodle,

Thanks for the help.

I tried with this technique in the help but cannot figure out how to use it / make it work :(
arnaud
 
Posts: 8
Joined: Sun Dec 11, 2016 11:18 am

What part are you stuck on? Also, search the support site. There are various articles there which show how to match on dates.
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I am stuck on the subfolder part :

Image

How can I choose the folder I want the file to be moved into ?

Thanks
arnaud
 
Posts: 8
Joined: Sun Dec 11, 2016 11:18 am

Right now, you have it sorting into a folder with the name of the file. Note you can specify whatever you want for that pattern. If you want the date attribute you defined, then add that in.
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Sorry I don't get it.

I have a folder called "invoiced to sort" where hazel importes the invoices with the "invoice dd.mm.yyyy.pdf" pattern.

Then I want hazel to sort these invoices into another folder "Invoices 12.2016" either existing or if not I would like hazel to create it regarding the file name.

How can I get hazel to do so ?

Regards
arnaud
 
Posts: 8
Joined: Sun Dec 11, 2016 11:18 am

In your screenshot, you see that you created a custom date attribute ("jour-mois..."). When you click in the field for "Sort into subfolder", if you look at the bottom, you'll see that same attribute there. The date you matched before is now available to be used in the name of the folder you are sorting the file into.'
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Ok, I Will try to use this, but first I think I need to simplify my folder architecture.

Btw, Will Hazel create à folder if it doesn't exist ?
arnaud
 
Posts: 8
Joined: Sun Dec 11, 2016 11:18 am

Yes, Sort into subfolder will create folders as needed or use existing ones.
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

OK fine, I am getting it !

Great !!! IT WORKS !!!!

Thanks !
arnaud
 
Posts: 8
Joined: Sun Dec 11, 2016 11:18 am


Return to Support