How to create year folder from file name and move all folder

Bulk Rename Utility How-To's

How to create year folder from file name and move all folder

Postby MnM007 » Fri Apr 26, 2024 4:31 pm

Hi,

I have photos organized in this fashion:
- Month folder like this - 04-APR-2024, 04-MAY-2024, etc
- each month folder has pictures inside with names like - 24-04-2024-15-09-04-001.jpg, 24-04-2024-15-09-22-002.jpg, etc

04-APR-2024
24-04-2024-15-09-04-001.jpg
24-04-2024-15-09-22-002.jpg
etc


I will like to create a top folder based on the folder name (04-APR-2024) with the year and then move all folders (and the pictures in each folder in it). So the new structure will look like:

2024
04-APR-2024
24-04-2024-15-09-04-001.jpg
24-04-2024-15-09-22-002.jpg
etc
05-MAY-2024
24-05-2024-15-09-04-001.jpg
24-05-2024-15-09-22-002.jpg
etc

If someone can help with the above I will appreciate it.
MnM007
 
Posts: 8
Joined: Fri Oct 28, 2022 10:05 am

Create YYYY parent-folder based on folder-name

Postby Luuk » Sat Apr 27, 2024 7:08 am

To create folders, must first put a checkmark inside for "Renaming Options, Allow using \ to create new folders".

To create folders based on folder-names, RegEx(1) needs a checkmark for 'v2', with "Match" and "Replace" like...
^\d\d-[A-Z]{3}-(20\d\d)$
$1\\$0

It moves any folder-name like your description (with its files) like...
SomePath\04-APR-2024 ---> SomePath\2024\04-APR-2024
Path\2024\04-APR-2024 ---> Path\2024\2024\04-APR-2024
(Without javascript it cant see parent-folders, so a new YYYY folder is always created)
Luuk
 
Posts: 711
Joined: Fri Feb 21, 2020 10:58 pm

Re: How to create year folder from file name and move all folder

Postby Admin » Mon Apr 29, 2024 12:47 am

Hi, you probably want to move all the pictures in the same root folder then organize them into subfolders using BRU:

2024
04-APR-2024
24-04-2024-15-09-04-001.jpg
24-04-2024-15-09-22-002.jpg
etc
05-MAY-2024
24-05-2024-15-09-04-001.jpg
24-05-2024-15-09-22-002.jpg
etc
Admin
Site Admin
 
Posts: 2359
Joined: Tue Mar 08, 2005 8:39 pm


Return to How-To