Recursing multiple subfolders (renaming)

A swapping-ground for Regular Expression syntax

Recursing multiple subfolders (renaming)

Postby Lionelnz » Wed Apr 30, 2008 8:47 pm

Hi all.

I want to rename multiple files in multiple subfolders which may have up to 3+ levels of subfolders after Level 1 subfolder.

I want remove the word "Unit " (with a space after it) from the front of files & any subfolders that may have it.

I can't use remove "5" char from front as not all files & folders will have "Unit " in front.

I have experimented with others such as remove "Word" before but it leaves the space.

I have experimented with Regex like this ("Unit ")(*.*) replace with \2 with not much success.

I have tried reading Regex tutorials & have searched this site to no avail.

I am using BRU 2.7.0.3 on XP with all the latest SP's & updates I think.

Can someone please explain how I can remove "Unit " from the front of my files & folders recursing all the subfolders as well as renaming any subfolders along the way.

BTW I think this is a powerful tool but I just do not how to use it effectively & efficiently.. I can use the simple commands & I understand certain basic DOS commands & wildcard characters but not familiar with Regex but I see I will need to if I want to get the most out this utility & willing to support Jim financially & maybe write specific examples to help others who are like me.

Cheers

Lionel DownUnda
Lionelnz
 
Posts: 2
Joined: Wed Apr 30, 2008 9:25 am

Re: Recursing multiple subfolders (renaming)

Postby Lionelnz » Thu May 01, 2008 12:27 am

I have resolved how to rename (by removing) text from files in the current folder (see below) e.g.

"Unit " (with a space after it) from the front of files & any subfolders that may have it.

In Section 5 (Remove), Word, I type Unit then I select the Trim option (which trims spaces from the word I am removing).

In Section 12 (Selections) I chose what I want to affect.

EasyPeasy lemon squeezy!!!! :D

Thanks Jim! Great Utility & I will email you privately.

Cheers

Lionel Downunda
Lionelnz
 
Posts: 2
Joined: Wed Apr 30, 2008 9:25 am

Re: Recursing multiple subfolders (renaming)

Postby Admin » Thu May 01, 2008 6:35 am

Or you could have used a RE as follows:

(Unit\s)(.*)
\2

Note the \s to indicate the space.


Jim
Admin
Site Admin
 
Posts: 2351
Joined: Tue Mar 08, 2005 8:39 pm


Return to Regular Expressions