Batch for check and rename

Post any general comments regarding Bulk Rename Utility here. Open to all registered users.

Batch for check and rename

Postby Lucatcs » Thu Jan 10, 2019 3:25 pm

hi all, I'm new here. I've used BRu for a while, but I've discovered just now that I can run scripts.
I'm not familiar to script in BRU, but I've got a general grasp of simple codes.
I need your help it is possible.
I've hundreds of folder called SHOT001, SHOT002 and so one.
Inside each folder, there's are png sequences
named: DE014SH001_000.png, DE014SH001_001.png and so one.
Unfortunately, sometimes, the person who exports those png doesn't follow the naming convention and forgot a "0" digit, making the name "DE014SH001_00.png" instead of "DE014SH001_000.png". Basically, we always need a name sequence with 3 digits, because the png sequences can easily be over 100 frames.
I've used BRU to rename the wrong sequences, but doing it by hand can take more than 30 minutes, which is time-consuming.
Is there any way to run a script in the main folder (which contains all the SHOT00X folders), checking if the name is wrong and rename the sequence with the right name?
Any help would be very helpful
Many Thanks
Luca C.
Lucatcs
 
Posts: 1
Joined: Thu Jan 10, 2019 2:07 pm

Re: Batch for check and rename

Postby therube » Thu Jan 10, 2019 6:40 pm

1:RegEx
Code: Select all
Match:  (^.*)_(\d\d)
Replace:  \1_0\2


That would find *._##.* & change it to *.0##.*
So that handles files 10-99.

It would not account for files like _#.

If a sequence was > 99, then the person putting in the number would have had to put in the proceeding '1' (or '2' ...), right?
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm


Return to General Comments


cron