Login  Register

Re: Filename extract and rename

Posted by Laurent.guerard on Feb 04, 2016; 8:36am
URL: http://imagej.273.s1.nabble.com/Filename-extract-and-rename-tp5015526p5015535.html

Hi,

What you could do is use this in a loop to remove the extension :

ImgName = Files[i];
StrInd1 = indexOf(ImgName, ".JPG");
//Get the name without the extension
ShortFileName=substring(ImgName,0, StrInd1);

Then depending on the way your images are called, you could use
indexOf(ShortFileName,"T10-something") to get the position in the whole
name of the part you're interested in and then use substring to only get
the part you'd like your files to be named with.

Hope this helps.

--
Laurent Guerard

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html