Subfolder rename from CSV

Bulk Rename Utility How-To's

Subfolder rename from CSV

Postby FXLEWIS » Mon Dec 08, 2025 8:40 pm

I was given a CSV with a listing of 100+ subfolder names that need to be changed.

Example -

Original Change To

\02._FDL_Submissions\ \02.FDL_Subs\

The problem is I only have the subfolder name. I don't have the full path.

As per the BRU guide:

Specifying Full Paths
You can also specify full paths, such as c:\folder\track1.mp3, in the first column for the old file names.
Then Bulk Rename Utility will match these names against the full path and not just the file name.
Partial / relative paths are not supported.

Example:

c:\folder1\Track001.mp3|Headlong.mp3

c:\folder2\Track002.mp3|Rushes.mp3

c:\folder3\Subfolder\TRACK003.mp3|AnywhereIs.mp3


I know the root folder where all the subfolders are located but they are scattered among other subfolders starting at the root. So I know the folders in my CSV are in T:\TST\GUIDES but there subfolders under GUIDES and then subfolders in those subs, etc.

Can I just use as input 02._FDL_Submissions and change as 02.FDL_Subs and have BRU search all of the subfolders below C:\TST\GUIDES and do the replacement?

TIA

Lewis
FXLEWIS
 
Posts: 12
Joined: Fri Dec 05, 2025 11:16 pm

Re: Subfolder rename from CSV

Postby FXLEWIS » Mon Dec 08, 2025 10:26 pm

Disregard. I figured it out.
FXLEWIS
 
Posts: 12
Joined: Fri Dec 05, 2025 11:16 pm

Re: Subfolder rename from CSV

Postby Admin » Tue Dec 09, 2025 11:26 pm

Use the Import Rename-Pairs CSV with just the old folder name in column 1 and the new folder name in column 2, then have Bulk Rename Utility scan the root with Subfolders enabled so it will find and rename matching folder names anywhere beneath that root.

Step-by-step:

1. In BRU, navigate to your root folder (T:\TST\GUIDES) in the left tree.
2. In Filters (12) enable:
- Folders (so folders are listed)
- Subfolders (so BRU does a recursive scan)
- Optionally set Lvl if you want to limit depth.
3. Prepare your CSV as OldName,NewName lines (you may use pipe or comma). Example:
02._FDL_Submissions,02.FDL_Subs
(You may omit paths — BRU will match the folder name itself.)
4. Actions > Import Rename-Pairs and select that CSV. BRU ignores case when matching.
5. Actions > Import Rename-Pairs > Select Imported Rename-Pairs to select the matching items in the list. Inspect the New Name column to confirm matches.
6. Preview and verify the list carefully. If everything looks correct, click Rename.

Notes:
- The import matches the name (or full path if you provided full paths). Because you only provided the folder name, BRU will match any folder with that name anywhere under the scanned root — so multiple folders with the same name will all be renamed.
- If you intend to rename folders (not files), make sure Folders is checked and review the preview. BRU refreshes the list automatically after folder renames when using recursive mode.
- Backup or test on a copy first (or run a small subset) — folder renames are disruptive and sometimes hard to undo.
- If you need to target only specific occurrences (e.g., only folders in certain subpaths), you must supply full paths in the CSV or use a filter/condition to restrict the selection.
Admin
Site Admin
 
Posts: 3141
Joined: Tue Mar 08, 2005 8:39 pm

Re: Subfolder rename from CSV

Postby FXLEWIS » Fri Jan 02, 2026 11:18 pm

Thanks. Follow up to my original post.

Here is a sample of my rename-pairs file:

COMMITTEE,CMTE
COMPLIANCE,CMP
CONTINUITY,CONT
CONTROL,CTRL
CORP,CRP
CORPORATE,CRP
COVER,CVR
CUSTOMER,CUST
DEPARTMENT,DEPT
DEPOSIT,DEP
DIRECTOR,DIR
DIRECTORS,DIR
DOCUMENTATATION,DOC
DOCUMENTS,DOC

I want to use the CSV file to change the name of any subfolder where the original name exists and replace it with the new name. This needs to work if there are multiple matches in the folder/subfolder.

For example, the original folders

COMMITTEE
COMMITTEE \ CONTROL_CORP_ESSAY
COMMITTEE \ CONTROL \ DEPOSIT
CORPORATE \ DIRECTOR \ DEPARTMENT

Would become
CMTE
CMTE \ CTRL \ CRP_ESSAY
CMTE \ CTRL \ DEP
CMTE \ CTRL \ DEPT
CRP \ DIR \ DEPT

I do not need to rename files, only folders/subfolders

One more note, I need to replace all spaces in folders with an underscore and I can't figure out how to get that to work in the CSV.

TIA

FL
FXLEWIS
 
Posts: 12
Joined: Fri Dec 05, 2025 11:16 pm

Re: Subfolder rename from CSV

Postby FXLEWIS » Fri Jan 02, 2026 11:21 pm

Had a typo

This - CMTE \ CTRL \ DEPT
Should be CMTE \ CTRL \ DEP
FXLEWIS
 
Posts: 12
Joined: Fri Dec 05, 2025 11:16 pm

Re: Subfolder rename from CSV

Postby Admin » Sat Jan 03, 2026 9:19 am

You can do this without CSV by using RegEx (1) with multiple Match/Replace pairs (one pair per mapping) and a final rule to convert spaces to underscores. Steps and a safe example follow.

Summary of approach
- Use RegEx (1) with the multiple RegEx editor to create one match/replace pair for each CSV line (match the whole word, replace with the abbreviation).
- Enable folders and subfolders in Filters so BRU lists and processes folder names.
- Add one extra RegEx pair to turn spaces into underscores (global).
- Preview thoroughly and back up before running Rename.

Step?by?step (recommended)
1. Open the folder containing your folders in Bulk Rename Utility.
2. In Filters (12):
- Check Folders = ON.
- Check Subfolders = ON (so nested folders are listed).
- Optionally set Lvl to limit recursion depth.
3. Click RegEx (1) panel.
- Tick Inc. Ext. is irrelevant for folders; leave it off.
- Click the multiple RegEx editor icon (the list editor) to add many Match/Replace pairs.
4. In the multiple RegEx editor add one row per mapping. Use word-boundary anchors (\b) and global (/g) so each occurrence in the folder name is replaced. Example rows (Match column / Replace column):

Match: \bCOMMITTEE\b/g
Replace: CMTE

Match: \bCOMPLIANCE\b/g
Replace: CMP

Match: \bCONTINUITY\b/g
Replace: CONT

Match: \bCONTROL\b/g
Replace: CTRL

Match: \bCORP\b/g
Replace: CRP

Match: \bCORPORATE\b/g
Replace: CRP

Match: \bCOVER\b/g
Replace: CVR

Match: \bCUSTOMER\b/g
Replace: CUST

Match: \bDEPARTMENT\b/g
Replace: DEPT

Match: \bDEPOSIT\b/g
Replace: DEP

Match: \bDIRECTOR\b/g
Replace: DIR

Match: \bDIRECTORS\b/g
Replace: DIR

Match: \bDOCUMENTATATION\b/g
Replace: DOC

Match: \bDOCUMENTS\b/g
Replace: DOC

// final row: replace any spaces with underscore (global)
Match: \s+/g
Replace: _

Notes on those entries
- Use \b to avoid partial-word replacements (so CORP won't match part of another token).
- The trailing /g on each Match tells BRU to replace all occurrences in the name (not just the first). The docs require adding /g to the Match pattern to perform global replacement.
- If you want case?insensitive matching, add /i (e.g. \bcommittee\b/gi) or use uppercase in the CSV and ensure filenames match case or add /i.
- The last rule converts any whitespace to underscores (global). If you only want spaces (not tabs), you can use a literal space in the match: (space)/g but \s+/g is usually fine.

5. After entering all pairs, click OK to close the editor.
6. In the main file list select the folders you want to process (or leave all selected).
7. Use Preview (or watch the New Name column) to verify the resulting folder names and the paths shown in New Name. Confirm that nested folder names are changed as you expect.
8. When satisfied, click Rename.

Extra points / safety
- Always run Preview first and test on a small copy of your folder tree.
- If a mapping can clash (two different folders become the same name under a parent), BRU will warn — check for name collisions.
- If some folder names contain punctuation you want preserved, check the regex patterns so you only replace tokens you mean to.
- If your CSV contains commas or quoted fields, it’s easier to paste or type the mapping into the multiple RegEx editor as shown above.
Admin
Site Admin
 
Posts: 3141
Joined: Tue Mar 08, 2005 8:39 pm

Re: Subfolder rename from CSV

Postby Admin » Sat Jan 03, 2026 9:21 am

With Replace (3) instead of Regex (1)

1) Prepare BRU so it will rename folders under subfolders
- In the main BRU window -> Filters (12): check Folders ON, Files OFF (so you only rename folders).
- Also check Subfolders ON (and set Lvl as needed) so BRU lists every folder/subfolder you want processed.

2) Open Replace (3) Multiple Replacements editor
- In Replace (3) click the multiple-replacements button (the two-column editor next to the With field).

3) Build the replacement table
- In the left column put each original token (COMMITTEE, CONTROL, CORPORATE, etc.). In the right column put the replacement (CMTE, CTRL, CRP, …). Add one extra row: left = (single space) but easiest is enter a single space character in the left column, right = _ (underscore) to replace spaces with underscores.
- Example rows:
- COMMITTEE CMTE
- CONTROL CTRL
- CORPORATE CRP
- DIRECTOR DIR
- DEPARTMENT DEPT
- (space) _
- Tip: copy/paste from your CSV into the two-column editor — BRU accepts tab-separated columns. If your CSV is comma separated, convert commas to tabs (or open in Excel and copy the two columns then paste into the editor). If any names contain commas, use quotes when preparing the data and then convert to tab-separated before pasting.

4) Matching options
- In Replace (3) leave Match Case unchecked (so matching ignores case).
- Ensure the “First” checkbox is NOT checked (otherwise it will only replace the first occurrence). By default Replace will apply replacements to all occurrences in the name — that allows multiple matches in the same folder name.
- Do NOT use the \regex\ prefix here (we’re using literal replacements). If you need regex later, use RegEx(1) instead (RegEx(1) supports /g and more powerful patterns).

5) Preview and run (very important)
- Select all folders in the file list (CTRL+A) or the subset you want to rename.
- Check the New Name column to confirm the replacements look as you expect (you should see multiple tokens changed inside path segments and spaces become underscores).
- If everything looks correct click Rename. BRU will perform the rename and will offer undo if something goes wrong.
Admin
Site Admin
 
Posts: 3141
Joined: Tue Mar 08, 2005 8:39 pm

Re: Subfolder rename from CSV

Postby lorixa » Mon Jan 05, 2026 3:00 pm

Thanks for the detailed explanation! Using the RegEx method to handle multiple renames in Bulk Rename Utility seems like a smart approach. I’ll definitely try this for my folder renaming task! :wink: :lol:
lorixa
 
Posts: 1
Joined: Mon Jan 05, 2026 2:59 pm

Re: Subfolder rename from CSV

Postby FXLEWIS » Thu Jan 08, 2026 8:48 pm

Thanks for the info. I tried both methods, but I was not able to successfully rename folders the way I wanted to. I do like the RegEx procedure.

Both procedures have a problem when there are TWO or more renames that need to be done on a folder/subfolder.

For example:

Folder name

CORPORATE_SECRETARY_MEETINGS
CORPORATE_SECRETARY_MINUTES

My RegEx entries included

\bCORP\b/g,CRP
\bCORPORATE\b/g,CRP
\bMEETING\b/g,MTG
\bMEETINGS\b/g,MTG
\bMINUTE\b/g,MIN
\bMINUTES\b/g,min
\bSECRETARY\b/g,SECTRY

So the two above should change to

CRP_SECTRY_MTG
CRP_SECTRY_MIN

Or am I incorrect?

FL
FXLEWIS
 
Posts: 12
Joined: Fri Dec 05, 2025 11:16 pm

Re: Subfolder rename from CSV

Postby Admin » Sat Jan 10, 2026 12:35 am

\b (word boundary) will NOT match around underscores, so your current patterns won't find those tokens in names like CORPORATE_SECRETARY_MEETINGS. Use anchors that treat start/end or underscore as boundaries instead.

Why \b fails here
- \b matches the boundary between \w and \W. In most regex flavors (including BRU's PCRE/Boost), underscore (_) counts as a word character (\w). So in CORPORATE_SECRETARY_MEETINGS the underscore sits between word characters and there is no \b between CORPORATE and the following underscore. Therefore \bCORPORATE\b won't match.

Recommended approach
Use lookarounds that require the match to be at start/end OR next to a non-alphanumeric character. For example (use Regex v2 and /g for global replacement):

- (?<![A-Za-z0-9])CORPORATE(?![A-Za-z0-9]) -> CRP
- (?<![A-Za-z0-9])SECRETARY(?![A-Za-z0-9]) -> SECTRY
- (?<![A-Za-z0-9])MEETINGS?(?![A-Za-z0-9]) -> MTG
- (?<![A-Za-z0-9])MINUTES?(?![A-Za-z0-9]) -> MIN

Notes:
- Use the plural forms before singular (MEETINGS before MEETING; MINUTES before MINUTE) or else a singular rule could match first and prevent the plural becoming the intended token.

Example applied to your filenames
With these matches and replaces (and using /g or default as needed), the results will be:
- CORPORATE_SECRETARY_MEETINGS -> CRP_SECTRY_MTG
- CORPORATE_SECRETARY_MINUTES -> CRP_SECTRY_MIN

PS you can import comma separated files directly in to the multi-regex editor in the latest version.
Admin
Site Admin
 
Posts: 3141
Joined: Tue Mar 08, 2005 8:39 pm

Re: Subfolder rename from CSV

Postby FXLEWIS » Tue Jan 13, 2026 2:52 pm

Thanks. I will try this tomorrow.

I must say, you team is great at responding and detail. Keep it up! Appreciate the info!

FL
FXLEWIS
 
Posts: 12
Joined: Fri Dec 05, 2025 11:16 pm

Re: Subfolder rename from CSV

Postby FXLEWIS » Fri Jan 16, 2026 8:24 pm

Hey, you guys have been great. Minor question.

My top folder is LGL_REN
I would like to EXCLUDE one subfolder and the subfolders of the excluded folder from any processing. Unfortunately, I don't have an option to move the subfolder out from under LGL_REN.

Example

LGL_REN
LGL_REN\INCLUDME

LGL_REN\RENAMEME\RENAMEME2

LGL_REN\DO NOT RENAME ME OR MY SUBS

LGL_REN\RENAMEME3\RENAME ME TOO


TIA. Your team is awesome!
FXLEWIS
 
Posts: 12
Joined: Fri Dec 05, 2025 11:16 pm

Re: Subfolder rename from CSV

Postby FXLEWIS » Fri Jan 16, 2026 8:56 pm

I am doing something wrong.

I have my pairs

Example

 (?<![A-Za-z0-9])AUTOMATE (?<![A-Za-z0-9]) AUTO
 (?<![A-Za-z0-9])AUTOMATED (?<![A-Za-z0-9]) AUTO
 (?<![A-Za-z0-9])BUSINESS (?<![A-Za-z0-9]) BUSN
 (?<![A-Za-z0-9])CHANGE (?<![A-Za-z0-9]) CHG
 (?<![A-Za-z0-9])CHANGED (?<![A-Za-z0-9]) CHG
 (?<![A-Za-z0-9])COMMERCIAL (?<![A-Za-z0-9]) CMRL
 (?<![A-Za-z0-9])COMMITTEE (?<![A-Za-z0-9]) CMTE
 (?<![A-Za-z0-9])COMPLIANCE (?<![A-Za-z0-9]) CMPL

In BUR I select my drive and a folder

Under the RegEx section I click on the match lines to open the RegEx list.

I pasted the first entry (?<![A-Za-z0-9])AUTOMATE (?<![A-Za-z0-9]) in the left column and the 2nd entry in the 2nd column AUTO

Click OK.

V2 is checked

Under filters I have checked folders, subfolders, and LVL = 0

In the RegEx Replace I see the entries for replacement picked up from the table.

When I click on PREVIEW, I get nothing to process. There's a least one subfolder MANAGEMENMT/MGMT and a CORPORATE / CORP that need to be replaced as just two examples.
FXLEWIS
 
Posts: 12
Joined: Fri Dec 05, 2025 11:16 pm

Re: Subfolder rename from CSV

Postby FXLEWIS » Sat Jan 17, 2026 1:10 am

I think I figured out my selection problem.
FXLEWIS
 
Posts: 12
Joined: Fri Dec 05, 2025 11:16 pm

Re: Subfolder rename from CSV

Postby FXLEWIS » Sat Jan 17, 2026 2:41 am

Scratch my last. Selection getting no items message.

It does not work if I use RegEx. If I use the individual replace it will look for whatever I put in as a single entry. Need to figure this out by 1400 EST on tomorrow (Saturday). I recommended this product. Going to need some answers if it does not work.
FXLEWIS
 
Posts: 12
Joined: Fri Dec 05, 2025 11:16 pm

Next

Return to How-To