how to rename - add 20 in front of name if it starts with 18

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

Re: how to rename - add 20 in front of name if it starts with 18

Postby therube » Thu Oct 24, 2019 4:57 pm

1:RegEx
Code: Select all
Match:  ^(18\d\d\d\d.*)$
Replace:  20\1

Match all files that start with 18, followed by 4 digits, followed by anything else.
Prefix those files with, 20.

---

Alternatively, you could pre-select, by various means, only files that start with 18, & then use:

7:Add -> Prefix: 20

One method to select would be:

12:Filters -> Mask: ^18\d\d\d\d (& checkmark, RegEx, box)
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: how to rename - add 20 in front of name if it starts with 18

Postby Growltiger » Thu Oct 24, 2019 5:30 pm

I would do it in two steps.
1. Add a 20 to the start of every filename.
Now some start 202018... and some start 2018...
2. Replace 2020 by 20 in every file.
Growltiger
 
Posts: 19
Joined: Tue Sep 24, 2019 5:03 pm

Re: how to rename - add 20 in front of name if it starts with 18

Postby Growltiger » Thu Oct 24, 2019 5:32 pm

Growltiger wrote:I would do it in two steps.
1. Add a 20 to the start of every filename.
Now some start 202018... and some start 2018...
2. Replace 2020 by 20 in every file.


Sorry, ignore this - I had missed that some files don't have a date at all.
Growltiger
 
Posts: 19
Joined: Tue Sep 24, 2019 5:03 pm

Re: how to rename - add 20 in front of name if it starts with 18

Postby Admin » Fri Oct 25, 2019 2:18 am

For the records, if you have a commercial license for BRU, then you can use a simple javascript routine:

Code: Select all
if (name.substring(0,2)== '18') newName = '20' + name;


JAVASCRIPT renaming is only supported with a commercial license.

thanks
Admin
Site Admin
 
Posts: 2343
Joined: Tue Mar 08, 2005 8:39 pm


Return to BRU Support