How to increment 2 numbers in middle of filename?

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

How to increment 2 numbers in middle of filename?

Postby RCurtis » Sat Dec 09, 2023 11:10 pm

I have a large number of media files based on date & time that were taken with incorrect timezone info.

Example: 2023120101_171242.jpg

The numbers that need to be adjusted will always be a 2 digit sequence starting in position 12.

The "17" in the above example needs to be decremented to "16".
If there is a file with "10" in that position I need to end up with "09"
None of the files were taken near midnight, so there is no concern over "crossing" the midnight barrier.

I have not been able to figure a way to do this in BRU...I assume it will require something with RegEx?

Any help appreciated!
RCurtis
 
Posts: 1
Joined: Sat Dec 09, 2023 11:02 pm

Re: How to increment 2 numbers in middle of filename?

Postby Admin » Mon Dec 11, 2023 10:45 am

Hi, I think you need BRU Javascript to extract the 2 digits from file, subtract one, replace with new value...
do you have a commercial license for BRU? I can post a quick script if you do.
I am not sure it is possible with RegEx.
Admin
Site Admin
 
Posts: 2354
Joined: Tue Mar 08, 2005 8:39 pm


Return to BRU Support


cron