Multiple folder rename


When i rename files i:

old name: (.).(.)
newname: 2006-03-12_.\2 (example)
type: regular expression

works great... however I want to batch rename folders, but not the contents of them. The above mentioned syntax does not work. According to the preview the before and after names of the folder are the same.

Any ideas?


I'm not exactly clear on what you are trying to do.

Are you trying to name folders and files in the same pass?

Are your folders named like this? FolderName.ext

Are you trying to just append a date to the folder name?

the folders are named:



i want to rename them to

103 etc

i figured it out!!



Okay, I'm working under these assumptions:[ol][li] All objects you wish to rename start with leading numbers.[/li]
[li] You only want to append the number "1" to the front of each such leading number in the new name.[/li][/ol]
My screen grab below shows files. To use this regular expression syntax for only folders, you must first use a toolbar button to select only folders, before you start the rename process (raw command = Select ALLDIRS).

[code]Field: Value

Old Name: ^([0-9]+)(.*)
New Name: 1\1\2
Type: Regular Expression[/code]
Below is a break down of what is going on in the Old Name regular expression syntax above, starting from the inside out.

Old Name: ^([0-9]+)(.*)[ul][li] 0-9 = This set of numeric characters : {0,1,2,3,4,5,6,7,8,9}.[/li]
[li] [ ] = Enclosing a term in brackets ([ and ]) indicates that any character from the enclosed set may match the target character position. We enclosed the range 0-9, meaning, we intend to match any single numeric character.[/li]
[li] + = The plus (+) is similar to an asterisk (which indicates that the character to the left of the asterisk in the expression should match 0 or more times), except there should be at least one match of the character to the left of the + sign in the expression. This means that instead of looking for a single numeric character, we will look for any number of consecutive numeric characters (but at least one--if the name starts with anything but a number, it will be skipped).[/li]
[li] b [/b]= The parenthesis affects the order of pattern evaluation. Also the expression that appears within parenthesis serves as a tagged expression which can be used to insert (or omit) the matched sub-string later in the New Name expression. In our case, we will use this particular tagged expression, b[/b], later in the New Name as \1.[/li]
[li] ^ = Match only at the beginning of the string. Without this, searching for our number substring would begin all the way at the right of the name, not the left. Furthermore, if more than one number substring existed inside the name, the first such substring on the right would be used. [/li]
[li] b[/b] The dot (.) will match any character. The asterisk (*) indicates that the character to the left of the asterisk in the expression should match 0 or more times. The parenthesis is used again to denote the second tagged expression which we will use later in the New Name as \2. This expression, b[/b], essentially says to take the remainder of the name as the second tagged expression.[/li][/ul]New Name: 1\1\2[ul][li] 1 = The actual number one that you wanted to append.[/li]
[li] \1 The first tagged expression from above (the orginal number)[/li]
[li] \2 The second tagged expression from above (the rest of the name)[/li][/ul]If you only wanted to rename the objects that specifically start with a two-digit number use this syntax:

[code]Field: Value

Old Name: ^([0-9][0-9])(.*)
New Name: 1\1\2
Type: Regular Expression[/code]

Notice the changes, b[/b] means look for two numeric characters. This will not find a single-digit number, nor will it find on a three-digit (or more) number.