Login  Register

Re: Bug report split(string, delimiters) macro function

Posted by Rainer M. Engel on Jul 24, 2014; 8:26am
URL: http://imagej.273.s1.nabble.com/Bug-report-split-string-delimiters-macro-function-tp5008864p5008873.html

Am 23.07.2014 18:08, schrieb Gabriel Schweighauser:

> Dear List,
>
> The built-in macro language function shows an unexpected behaviour if an
> "empty" column is present in the string.
>
> Example:
>
> split("1,2,3,,5",",");
>
> returns the same array as:
>
> split("1,2,3,5",",");
>
> Hence, parsing tables with "empty" cells from csv-files does not work.
>
> Is there a way to fix this?
>
> We're using ImageJ 1.49b.
>
>
> Thanks for your reply,
> Gabriel
>


Hello Gabriel,

we came across this a few days ago. I don't think that it is a bug,
since this behaviour might be mandatory in other cases.

I wrote a macro function to fill empty fields for which the user has to
define a char he wants to fill with. This worked for my purposes.
https://dl.dropboxusercontent.com/u/414433/imagej/macros/function_fillEmptyFields.ijm

Does it work for you?

Best regards,
Rainer


--
Rainer M. Engel, Dipl. Digital Artist
scientific|Media GbR
Pichelsdorfer Str. 143
13595 Berlin

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