Renaming files name from only beginning of folder name

Post any Bulk Rename Utility support requirements here. Open to all registered users.

Renaming files name from only beginning of folder name

Postby Bishop_2020 » Mon Mar 30, 2020 8:56 pm

Hi,

I have thousands of folders with files in them. I would like to rename every files with only the beginning section of the folder name.

My folders are named with this convention:

The Awesome Android v1 - 01 - Meet your Doom

I would like every files to be renamed:

The Awesome Android v1 - 01 - 00
The Awesome Android v1 - 01 - 01
The Awesome Android v1 - 01 - 02
The Awesome Android v1 - 01 - 03
etc...

then
The Awesome Android v1 - 02 - 00
The Awesome Android v1 - 02 - 01
The Awesome Android v1 - 02 - 02
The Awesome Android v1 - 02 - 03
etc...

I tried everything I could think of.... but I'm always stuck with the full folder name...


Any ideas?

Regards,
Bishop_2020
 
Posts: 2
Joined: Mon Mar 30, 2020 7:07 pm

Re: Renaming files name from only beginning of folder name

Postby Admin » Tue Mar 31, 2020 12:03 am

Hi, using Javascript you could use the property object("folder") and then manipulate that as you need and add it to the file name.
Admin
Site Admin
 
Posts: 1895
Joined: Tue Mar 08, 2005 8:39 pm

Re: Renaming files name from only beginning of folder name

Postby Bishop_2020 » Tue Mar 31, 2020 12:16 pm

Thank you for reply!

Not familiar with javascript programming... any idea what would be the code?
Bishop_2020
 
Posts: 2
Joined: Mon Mar 30, 2020 7:07 pm

Re: Renaming files name from only beginning of folder name

Postby RegexNinja » Tue Mar 31, 2020 3:02 pm

Admin.. Thanks for the tip!!

#10Numbering:
Start=0, Incr=1, Pad=2, Folder=Checked

#12Filters:
SubFolders=Checked
Condition=/.*\\(.+ v\d - \d{1,2}) - [^\\]*\\$/.test(object('folder'))

#14Javascript:
newName=object("folder").replace(/.*\\(.+ v\d - \d{1,2}) - .+\\$/, '$1' + ' - ' + object("autonumber"))

#12-Condition matches files in ParentFolderNames like: AnyText v1Digit - 1or2Digits - AnyText.
#12-SubFolders lets you select upper-level folders to rename ALL sub-files (within such ParentFolders).
#14 Javascript keeps everything in ParentFolder until the final v1Digit - 1or2Digits.

Folder: The Awesome Android v1 - 01 - Meet your Doom
OrigName1.ext ---> The Awesome Android v1 - 01 - 00.ext
OrigName2.ext ---> The Awesome Android v1 - 01 - 01.ext, ...

Folder: AnyParticularName v6 - 4 - AnyText
OrigName1.ext ---> AnyParticularName v6 - 4 - 00.ext
OrigName2.ext ---> AnyParticularName v6 - 4 - 01.ext, ...

Folder: AnyName 11 01 AnyText
OrigName1.ext ---> no effect (no v# in ParentFolderName)
RegexNinja
 
Posts: 134
Joined: Fri Feb 21, 2020 5:26 pm

Re: Renaming files name from only beginning of folder name

Postby Admin » Wed Apr 01, 2020 2:01 am

8) 8)
Admin
Site Admin
 
Posts: 1895
Joined: Tue Mar 08, 2005 8:39 pm


Return to BRU Support