Login  Register

Re: remove extension image's filename

Posted by Thomas Boudier on Mar 20, 2009; 3:53pm
URL: http://imagej.273.s1.nabble.com/remove-extension-image-s-filename-tp3693232p3693234.html

Hi,

Something I use a lot for that is : replace(string, old, new)

for instance xls_name=replace(title,".tif",".xls");

Thomas


Eric BADEL a écrit :

> Hi all,
> It is probably so simple ! Sure, I should find in the archives but I
> searched and I found only a tricky method.
> Let's open an image and get its title (title=getTitle()). Then, do many
> things and measurements with it than finally save the results and an another
> resulting image with the same name.
>
> Example:
> The initial image I open is "toto.tif"
> I want to save final results as "toto.xls" (and not "toto.tif.xls")
> and an another resulting image as "toto_loc.tif" (and not "toto.tif_loc.tif")
>
> For that, we need to get "toto".
> Thank you
> Eric
>
>

--
   /**********************************************************/
      Thomas Boudier, MCU Université Pierre et Marie Curie,
      IFR 83. Bat B 7ème étage, porte 709, Jussieu.
      Tel : 01 44 27 20 11  Fax : 01 44 27 22 91
/*******************************************************/