rename = name + 1

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

rename = name + 1

Postby boomp » Thu Jun 09, 2022 5:51 pm

hi, need to rename a lot of files in this way:

1.txt to 2.txt
2.txt to 3.txt
3.txt to 4.txt
and so on...

Is there a way to do that with BRU? or with javascript?
thanks in advance
boomp
 
Posts: 2
Joined: Thu Jun 09, 2022 5:48 pm

Add 1 to filename

Postby Luuk » Thu Jun 09, 2022 11:24 pm

https://www.bulkrenameutility.co.uk/forum/viewtopic.php?f=2&t=4849#p13292
This a link using the javascript to add 559, but it does also rename everything that ends with a number.
So Im thinking to change 559 ==> 1 and use if (/^\d+$/.test(name)) { to rename files with only numbers.
Luuk
 
Posts: 690
Joined: Fri Feb 21, 2020 10:58 pm

Re: rename = name + 1

Postby boomp » Fri Jun 10, 2022 3:33 am

it works perfectly even without changing anything
thanks a lot !!!!!!
boomp
 
Posts: 2
Joined: Thu Jun 09, 2022 5:48 pm


Return to Javascript Renaming