Dear ines,
You are looking for the instruction "substring(string, index1, index2)" from:
https://imagej.nih.gov/ij/developer/macro/functions.html#substringSo your code could be something like:
name = substring(original_name, 0, 5) + "t" + IJ.pad( number, 4 ) + ".tif";
My best regards,
Philippe
Le Vendredi 8 Juillet 2016 11:37 CEST, inesica <
[hidden email]> a écrit:
> 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:
http://imagej.1557.x6.nabble.com/very-simple-question-about-rename-macro-tp5016831.html> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html