Create Folders from filename (in date format)

Bulk Rename Utility How-To's

Create Folders from filename (in date format)

Postby MrBlond01 » Tue Nov 12, 2024 5:10 pm

I have a load of pictures with filenames in the following format:
yyyymmdd_imagenumber.jpg

Example:
20151103_180441.jpg

I would like the files to be rearranged in folders created with the date in the filename i.e.

2015-11-03\20151103_180441.jpg

I have looked through the forum, googled, and tried various options related to RegEx (1), and also have the option 'Allow using '\' in renaming criteria...' on, but I am still at a loss of how to do this.

Any help would be appreciated.
MrBlond01
 
Posts: 2
Joined: Tue Nov 12, 2024 5:02 pm

Re: Create Folders from filename (in date format)

Postby Admin » Tue Nov 12, 2024 11:27 pm

Hi! After enabling the option Advanced Options > Allow Using '\' in Renaming Criteria for Creation of New Folders,
we need to extract the date from the file name before the _ and make a folder of it.

We can do that with RegEx(1)

Enable Simple in RegEx (1).

Then

Match: %1_%2
Replace: %1\%1_%2

This will extract the part of text before _ and make it into a folder, but also still keep it in the file name.

Then to reformat the folder name, use Name (2) and set Name to Reformat Date.
This will try to automatically find a date in the name and reformat it to YYYY-MM-DD.

Then we are ready to rename. Select the files you wish to rename and click on "Preview / Rename". Make sure you backup all your files before proceeding.
Admin
Site Admin
 
Posts: 2883
Joined: Tue Mar 08, 2005 8:39 pm

Re: Create Folders from filename (in date format)

Postby MrBlond01 » Fri Nov 15, 2024 5:21 pm

That's fantastic. It's so simple I'm feeling a little foolish for not getting it myself. However, you have saved me a lot of time so thank you!
MrBlond01
 
Posts: 2
Joined: Tue Nov 12, 2024 5:02 pm


Return to How-To