Page 1 of 1

How to increment 2 numbers in middle of filename?

PostPosted: Sat Dec 09, 2023 11:10 pm
by RCurtis
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!

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

PostPosted: Mon Dec 11, 2023 10:45 am
by Admin
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.