Removing current folder name location from file name

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

Removing current folder name location from file name

Postby Wryson » Tue Aug 20, 2019 11:01 pm

So I've got a lot of files within folders, and every file has as part of its name the current folder it's in. However, I've got roughly 1,200 folders, and within each of them are are anywhere between one and thirty files.

Is it possible to write a script so that BRU will open up each folder, see the file name, and rename it so that it doesn't include the folder name?

Example, I have a .txt file that is in the folder named GREEN, and it has its name as GREEN-Mulch.txt

Can i write the script so that it renames it to only be "-Mulch.txt" and leave off the name of the folder it's in? I know that we can APPEND the folder name, but how do I REMOVE it?
Wryson
 
Posts: 4
Joined: Tue Aug 20, 2019 10:44 pm

Re: Removing current folder name location from file name

Postby therube » Wed Aug 21, 2019 1:47 am

Oh, outside of the JavaScript renaming feature, I don't think that's going to happen.
therube
 
Posts: 657
Joined: Mon Jan 18, 2016 6:23 pm

Re: Removing current folder name location from file name

Postby Wryson » Wed Aug 21, 2019 3:12 am

Right..that's what I was asking. :)

Is there a way to do this? Does someone know how to write the code for it? BRU seems to have the ability to run a script, but I don't know how to code it.
Wryson
 
Posts: 4
Joined: Tue Aug 20, 2019 10:44 pm

Re: Removing current folder name location from file name

Postby Admin » Wed Aug 21, 2019 4:41 am

Yes, Javascript can do that. Do you have a commercial license for BRU? (required to use Javascript). thanks
Admin
Site Admin
 
Posts: 1675
Joined: Tue Mar 08, 2005 8:39 pm

Re: Removing current folder name location from file name

Postby Wryson » Wed Aug 21, 2019 5:26 am

I need a license for it? It looks like I can just type in the code here and run it, no? The problem is knowing what the code is.

Why would I need a license if the free version that's available from this very site has the option to do so, if I knew the java code?
Wryson
 
Posts: 4
Joined: Tue Aug 20, 2019 10:44 pm

Re: Removing current folder name location from file name

Postby Admin » Thu Aug 22, 2019 7:22 am

Hi, the Javascript renaming is only active with a commercial license.
Admin
Site Admin
 
Posts: 1675
Joined: Tue Mar 08, 2005 8:39 pm


Return to Javascript Renaming