Divide / Split Folder Name and Move Contents

Bulk Rename Utility How-To's

Divide / Split Folder Name and Move Contents

Postby swingking03 » Thu May 12, 2022 2:27 am

I know this information is somewhere on this forum as I've used it before, but I cannot find it for the life of me.

I would like to split a folder based on a delimiter and move the contents of the folder to the newly created, nested folder.

Example:

Current Folder: 2021 - Hawaii

Desired Output: 2021\Hawaii (New folder called Hawaii within 2021 folder, and all the images now reside within Hawaii folder.

I have the Advanced Options "Allowing using \...." enabled.
swingking03
 
Posts: 8
Joined: Thu May 12, 2022 2:22 am

Re: Divide Folder and Move Contents

Postby swingking03 » Thu May 12, 2022 3:49 pm

I managed to figure this out so posting the solution I used for others. If there is a better solution, please let me know.

To divide based on a delimiter of " - "
Match: ([^ - ]*) - ([^ - ]*)
Replace: \1\\2
swingking03
 
Posts: 8
Joined: Thu May 12, 2022 2:22 am

Re: Divide Folder and Move Contents

Postby Admin » Fri May 13, 2022 1:44 am

Hi, if you enable "Simple" in RegEx(1), then you can use a simplified syntax:

Match: %1 - %2
Replace: %1\%2

The outcome is the same!
cheers
Admin
Site Admin
 
Posts: 2341
Joined: Tue Mar 08, 2005 8:39 pm


Return to How-To