Login  Register

Re: Filename extract and rename

Posted by Herbie on Feb 04, 2016; 10:32am
URL: http://imagej.273.s1.nabble.com/Filename-extract-and-rename-tp5015526p5015537.html

Richie,

why didn't you follow my suggestions? It's really easy.

Here is a snippet that does the desired text-processing
(please watch for line breaks introduced by the mailer):

f_name = "image_D2016-02-02T10-30-23-653793Z_0.JPG";
f_name = substring( f_name, indexOf( f_name, "T" ), lengthOf( f_name )-4 );
print( f_name );

HTH

Herbie

:::::::::::::::::::::::::::::::::::::::::
Am 04.02.16 um 08:57 schrieb richieclose:

> Thanks Herbie - you're probably right in that using imagej for text
> processing would not be ideal, but I am looking to minimise the
> number of tools/programming languages I have to learn!
>
> I was looking that the text-processing functions but not sure if they
> are suitable as the file length will vary and it turns out I'll need
> to remove the .jpg also.  Would the split functional be more
> suitable?  Also, are there any good examples of split being
> implementing in a macro?
>
>
>
> -- View this message in context:
> http://imagej.1557.x6.nabble.com/Filename-extract-and-rename-tp5015526p5015534.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