Login  Register

Re: spaces in filenames

Posted by Michael Schmid on Jun 09, 2009; 3:30pm
URL: http://imagej.273.s1.nabble.com/spaces-in-filenames-tp3692208p3692209.html

Hi Jon,

use square brackets around the filename:

run("Raw...", "open=[" + path + "] image=[16-bit Unsigned] width=" +  
width + " height=" + height +" offset=0 number=1 gap=0 little-endian");


Michael
________________________________________________________________

On 9 Jun 2009, at 17:09, Jon Harman wrote:

> Hi,
>
> I have a macro that opens a raw data file.  It gets the path:
> path = File.openDialog("Select an image (16 bit raw)");
>
> then uses the raw import to read the file:
> run("Raw...", "open=" + path + " image=[16-bit Unsigned] width=" +  
> width + " height=" + height +" offset=0 number=1 gap=0 little-
> endian");
>
> My problem is that spaces in the filename cause the raw import to  
> fail.
> I have tried replacing them with "%20" and "\ ", neither works.
>
> Can anyone suggest a solution?
>
> Jon