Rename folders based on file name within each folder

Javascript renaming examples. Javascript renaming is supported in version 3 or newer.

Rename folders based on file name within each folder

Postby ITEM9 » Tue May 30, 2017 8:35 pm

I want to rename a batch of folders based on the name of a file within each folder. The file names within each folder all follow a pattern as such:

sky897RTY_209746001.jpg
sky897RTY_209746002.jpg
sky897RTY_209746003.jpg
sky897RTY_209746004.jpg
And so on....

I wish to rename the parent folder as such:

sky897RTY_209746

Basically, I want the last three characters of the "001" file removed and then rename the parent folder with it. All of the folders follow this pattern.

This is probably pretty easy, but I don't have much experience with JavaScript. Thanks!
ITEM9
 
Posts: 1
Joined: Tue May 30, 2017 8:12 pm

Return to Javascript Renaming