.csv format

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

.csv format

Richard Mort-2
Hi,

I would like to save the results table as a .csv file that is comma
delimited from a macro so that I can parse it with a .py script to sort
the data and then import back into ImageJ. If I use jfilechooser to save
manually this works fine. However when I run the following from a macro
the file is always tab delimited.

run("Input/Output...", "jpeg=85 gif=-1 file=.csv use use_file copy_row
save_column save_row");
selectWindow(ImageID+"_Tracking_Table");
saveAs("Results", "/tmp/Results.csv");

How can I ensure the .csv file is truly comma delimited?

Best
R

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: .csv format

Rasband, Wayne (NIH/NIMH) [E]
> On May 12, 2015, at 6:20 AM, Richard Mort <[hidden email]> wrote:
>
> Hi,
>
> I would like to save the results table as a .csv file that is comma delimited from a macro so that I can parse it with a .py script to sort the data and then import back into ImageJ. If I use jfilechooser to save manually this works fine. However when I run the following from a macro the file is always tab delimited.
>
> run("Input/Output...", "jpeg=85 gif=-1 file=.csv use use_file copy_row save_column save_row");
> selectWindow(ImageID+"_Tracking_Table");
> saveAs("Results", "/tmp/Results.csv");
>
> How can I ensure the .csv file is truly comma delimited?

This bug is fixed in the latest ImageJ daily build (1.49t20). The first line of your example macro is not needed. The “File extension for tables” value in Edit>Options>Input/Output is ignored when the saveAs() file name extension is “.csv”.

-wayne


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: .csv format

Richard Mort-2
That's great
Best
R

On 12/05/15 14:49, Rasband, Wayne (NIH/NIMH) [E] wrote:

>> On May 12, 2015, at 6:20 AM, Richard Mort <[hidden email]> wrote:
>>
>> Hi,
>>
>> I would like to save the results table as a .csv file that is comma delimited from a macro so that I can parse it with a .py script to sort the data and then import back into ImageJ. If I use jfilechooser to save manually this works fine. However when I run the following from a macro the file is always tab delimited.
>>
>> run("Input/Output...", "jpeg=85 gif=-1 file=.csv use use_file copy_row save_column save_row");
>> selectWindow(ImageID+"_Tracking_Table");
>> saveAs("Results", "/tmp/Results.csv");
>>
>> How can I ensure the .csv file is truly comma delimited?
> This bug is fixed in the latest ImageJ daily build (1.49t20). The first line of your example macro is not needed. The “File extension for tables” value in Edit>Options>Input/Output is ignored when the saveAs() file name extension is “.csv”.
>
> -wayne
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html


--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

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