Shift double numbering by one in nested loop

Bulk Rename Utility How-To's

Shift double numbering by one in nested loop

Postby madrigallo » Thu Jul 04, 2024 4:12 pm

Hi all, I'd be very grateful for help here.

I have few thousands of files that go like this:
TRITC - [0001, 0001, 0001].ome.tiff
TRITC - [0001, 0002, 0001].ome.tiff
TRITC - [0001, 0003, 0001].ome.tiff
...
TRITC - [0001, 0360, 0001].ome.tiff
TRITC - [0002, 0001, 0001].ome.tiff
...
TRITC - [0002, 0360, 0001].ome.tiff
TRITC - [0003, 0001, 0001].ome.tiff
...
TRITC - [0018, 0360, 0001].ome.tiff

The first four-digit number is position, the second four-digit number is timepoint. (The third four-digit number is channel and is not relevant, should stay unchanged).
I need to subtract one from the two first four-digit numbers, so the resulting names would be
TRITC - [0000, 0000, 0001].ome.tiff
TRITC - [0000, 0001, 0001].ome.tiff
...
TRITC - [0017, 0359, 0001].ome.tiff

Any ideas? Many thanks!
madrigallo
 
Posts: 1
Joined: Thu Jul 04, 2024 4:06 pm

Re: Shift double numbering by one in nested loop

Postby Admin » Thu Jul 04, 2024 4:33 pm

It can be done, with a JavaScript renaming script in BRU, if you have a commercial license.
Admin
Site Admin
 
Posts: 2662
Joined: Tue Mar 08, 2005 8:39 pm


Return to How-To