How to increase +1 (or +n) to file names

Bulk Rename Utility How-To's

How to increase +1 (or +n) to file names

Postby Bulkamateur » Sun Oct 25, 2020 5:56 am

I have thousands of .wav files for a game that I'd like to change by adding +2 to them (or +n to them really)

Current:__________To_____Desired:
274attk.wav______________276attk.wav
274dfnd.wav_____________ 276dfnd.wav
274shot.wav______________276shot.wav
274kill.wav_______________276kill.wav
274move.wav_____________276move.wav
274wnce.wav_____________276wnce.wav
275attk.wav______________ 277attk.wav
275dfnd.wav______________277dfnd.wav
275shot.wav______________277shot.wav
275kill.wav_______________277kill.wav
275move.wav_____________277move.wav
275wnce.wav_____________277wnce.wav

....to series 2200__________.....series 2202


I know that if I use the remove function I can preserve the character texts, but then i'm stuck with the same problem of adding each number by (n) value.

Please help
Bulkamateur
 
Posts: 3
Joined: Sun Oct 25, 2020 5:37 am

Re: How to increase +1 (or +n) to file names

Postby Admin » Sun Oct 25, 2020 11:30 am

Hi, it can be done with Javascript renaming, parse out the first 3 digits, add + 2 (or +n) and add back to the front of the name.
Admin
Site Admin
 
Posts: 2354
Joined: Tue Mar 08, 2005 8:39 pm

Re: How to increase +1 (or +n) to file names

Postby Bulkamateur » Sun Oct 25, 2020 9:19 pm

Thank you for the response,

I have never used javascript and I don't know how to write code. I just downloaded the BRU a few days ago and this is all fairly new to me. Is there a database I can copy and paste such things, or if anyone reads this, and if it does not require much work, can they write the script for me here?

Thanks again for your attention on this :)
Bulkamateur
 
Posts: 3
Joined: Sun Oct 25, 2020 5:37 am

Re: How to increase +1 (or +n) to file names

Postby Admin » Sun Oct 25, 2020 11:19 pm

Hi, I can write the script but javascript renaming requires a commercial license , do you have one? Are you using BRU in a business? Thanks
Admin
Site Admin
 
Posts: 2354
Joined: Tue Mar 08, 2005 8:39 pm

Re: How to increase +1 (or +n) to file names

Postby Bulkamateur » Mon Oct 26, 2020 1:11 am

No I don't have a commercial license unfortunately. I was changing the names of the files for a PC game so it's only for personal use. I guess I'm out of luck then?
Bulkamateur
 
Posts: 3
Joined: Sun Oct 25, 2020 5:37 am

Re: How to increase +1 (or +n) to file names

Postby Admin » Mon Oct 26, 2020 11:41 pm

Javascript to increment the first 3 digits in a name by 2 in Bulk Rename :

Code: Select all
numofchars = 3;
increment = 2;

d = name.substring(0, numofchars)
r = name.substring(numofchars)
n = parseInt(d);
n = n + increment;

newName = n.toString() + r;
Admin
Site Admin
 
Posts: 2354
Joined: Tue Mar 08, 2005 8:39 pm


Return to How-To