Re: very simple question about rename macro

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Re: very simple question about rename macro


It is better to use really powerful batch renaming tool of Total Commander.
In linux I use Krename succesfully.

In macro you will need to split the original name, replace respective part
with desired string and reconstruct the file name using for cycle.

parts=split(title, "_");
for (p=1; p<parts.length; p++) {
   name = name+"_"+parts[p];

Or you can use function replace:
name=replace(title, "z0000_", "img1");

hope this helps a little.
Dne 8.7.2016 11:37 "inesica" <[hidden email]> napsal(a):

> Hello,
> I have a very very simple question. I would like to rename my files and  I
> have the corresponding program. In the process of renaming my files, i
> would
> like one part of the original name to stay the same: for ex. the name is
> z0000_t0005, with the program it becomes z0000_t0004, but instead of
> writing
> name = "z0000_" + "t" + IJ.pad( number, 4 ) + ".tif";
> I would like to replace "z0000_" with something that would say that the
> values of the original name from 1 to 6 should remain the same in my new
> name function.
> How could I do that?
> Thank you very much.
> --
> View this message in context:
> Sent from the ImageJ mailing list archive at
> --
> ImageJ mailing list:

ImageJ mailing list: