Posted by
Herbie on
May 06, 2016; 1:37pm
URL: http://imagej.273.s1.nabble.com/macro-rename-files-simple-tp5016330p5016332.html
Inesica,
is this
//----------------------------------------------------
m = -4;
name = "z0007_t0000";
number = parseInt( substring( name, 1, 5 ) );
number +=m ;
//if ( number < 10 ) { name = "z000"; } else { name = "z00"; }
name = "z" + IJ.pad( number, 4 ) + "_t0000";
print( name );
//----------------------------------------------------
what you are looking for?
You've ask a very similar question before and of course the answer is
rather similar...
You may have a look at
<
http://rsb.info.nih.gov/ij/developer/macro/functions.html>
for the available ImageJ-macro functions.
Best
Herbie
:::::::::::::::::::::::::::::::::::::
Am 06.05.16 um 14:27 schrieb inesica:
> Hello everybody. I would be very grateful if you could help me create
> a macro in image J:
>
> - I open images in format (z000x_t000y, where y stays constant) that
> I want to save with a new name. I want to change the X value by
> adding or subtracting a certain value m (x+/-m). For example for
> z0005_t0000, z0006_t0000, z0007_t0000, if my m is -4, i would like to
> save the files as z0001_t0000, z0002_t0000, z0003_t0000 etc.
>
> Thank you very much in advance for your help.
>
>
>
> -- View this message in context:
>
http://imagej.1557.x6.nabble.com/macro-rename-files-simple-tp5016330.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