Move image files to sub-folders based on a part of filename

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

Moderator: Mr_Noodle

Hi,
I have searched everywhere and tried a few ways but I can;t seem to figure this one out.

I have a thousands of scanned image files in the following name format "00642_04_newscan.jpg". So for each roll of film there are 36 image files (sometimes more, sometimes less) and they all go into one folder at the moment before being sucked into Capture One for processing.

I want to be able to get Hazel to watch the folder that contains all the image files and then move all images that match this pattern "00xxx_xx_newscan.jpg" and create a folder called "xxx" and then move the files inside that folder.

In the above example the folder would be named "642" which is film roll 642 and then inside that would be 00642_01_newscan.jpg, 00642_02_newscan.jpg, 00642_03_newscan.jpg, 00642_04_newscan.jpg etc.

Thanks for any help you can offer.
rollbahn
 
Posts: 3
Joined: Mon Oct 07, 2019 1:20 am

Look up "match patterns" in the help. You can set up a pattern that mirrors what you posted. Set up a custom attribute for the XXX number and you can then use that in subsequent actions.
Mr_Noodle
Site Admin
 
Posts: 8107
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Look up "match patterns" in the help. You can set up a pattern that mirrors what you posted. Set up a custom attribute for the XXX number and you can then use that in subsequent actions.


Thanks - I have no issues with the match pattern part to find the files but I can't figure out how to loop around and put just the image files that match a certain roll number inside the matching folder. So after I reach 00642_36_newscan.jpg (the final shot on that roll of film) the next file is 00643_01_newscan.jpg and that needs to create a new folder "643" and only put in the files that match 643 and so on.

I will keep trying and see what I can sort out I guess.
rollbahn
 
Posts: 3
Joined: Mon Oct 07, 2019 1:20 am

Once I found the "Custom Text" option where I could hold the number of the roll in a "variable" then everything fell into place and was stupidly easy to do. :D

If anyone is looking to do something like this:

* "Name" matches whatever files you want to find to sort - enter your pattern of the file you want and use "Custom Text" for the part of the filename you want to grab and use as the folder name later
* Then do the following to the matched files/folders - "Sort Into Subfolders" with pattern and use the Custom Text name from above and you're done!
rollbahn
 
Posts: 3
Joined: Mon Oct 07, 2019 1:20 am


Return to Support