Login  Register

Re: Replace part of string help

Posted by Julien Colombelli on Jul 28, 2011; 10:35am
URL: http://imagej.273.s1.nabble.com/Replace-part-of-string-help-tp3683695p3683697.html

Hi Adam,

very manual but it works:

name = "Job(Seq.Scan) 2 02_024_z0_ch01.tif";

string1= substring(name, 0,3);
string2= substring(name, 13,34);

print(string1+string2);

For sure there's a more elegant solution

cheers,
J


On 28 July 2011 12:22, Dr Adam Cliffe <[hidden email]> wrote:

> Hi,
>
> I'm trying to remove part of a file name.
> Current file name is : "Job(Seq.Scan) 2 02_024_z0_ch01.tif"
> I'd like to remove the (Seq.Scan) part.
>
> using the following macro I end up with: Job() 2 02_024_z0_ch01.tif
>
> name = "Job(Seq.Scan) 2 02_024_z0_ch01.tif";
> string=replace(name,"(Seq.Scan)","");
> print(name);
>
> Can anyone help getting rid of the brackets please?
>
> thanks
>
> Adam
>
>
> Dr Adam Cliffe
> Research Scientist, Rorth Lab
>
> Institute of Molecular and Cell Biology
> 61 Biopolis Drive
> Proteos
> Singapore 138673
>
> tel: +65 6586 9731
>



--
Julien Colombelli
Advanced Digital Microscopy
Institute for Research in Biomedicine - IRB Barcelona
Baldiri Reixac, 10
Tel:  +349340-20451
Fax: +34934031116
E-08028 Barcelona - Spain
[hidden email]