Saving Log window as a csv file but not a txt file

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

Saving Log window as a csv file but not a txt file

Tomm
Hi all,

I want to save a text of Log window as a csv file.
But the txt file was saved.
How can I change the extension from txt to csv?
Here is my macro code.

--
dir = getDirectory("Choose a Directory");
name = "test";
print("10"+","+"20");
saveAs("Text", dir +name + ".csv");
--

Thanks,
Tomm
Reply | Threaded
Open this post in threaded view
|

Re: Saving Log window as a csv file but not a txt file

Michael Schmid
Hi Tomm,

maybe you have selected ".txt" in Edit>Options>Input/Output...

By the way, also this Options command can be recorded by Plugins>Macros>Record. So if you want to make sure that the setting is correct, you could add it to your macro.

Michael
________________________________________________________________
On Apr 16, 2015, at 14:38, Tomm wrote:

> Hi all,
>
> I want to save a text of Log window as a csv file.
> But the txt file was saved.
> How can I change the extension from txt to csv?
> Here is my macro code.
>
> --
> dir = getDirectory("Choose a Directory");
> name = "test";
> print("10"+","+"20");
> saveAs("Text", dir +name + ".csv");
> --
>
> Thanks,
> Tomm
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/Saving-Log-window-as-a-csv-file-but-not-a-txt-file-tp5012505.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
Reply | Threaded
Open this post in threaded view
|

Re: Saving Log window as a csv file but not a txt file

Tomm
Thanks, Michael. But I already have set the point as below. I added the code, but the problem was not solved.
--
run("Input/Output...", "jpeg=100 gif=-1 file=.csv copy_column copy_row save_column save_row");
--
Could you have another idea?
Thanks,
Tomm
Reply | Threaded
Open this post in threaded view
|

Re: Saving Log window as a csv file but not a txt file

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by Tomm
> On Apr 16, 2015, at 8:38 AM, Tomm <[hidden email]> wrote:
>
> Hi all,
>
> I want to save a text of Log window as a csv file.
> But the txt file was saved.
> How can I change the extension from txt to csv?
> Here is my macro code.

> --
> dir = getDirectory("Choose a Directory");
> name = "test";
> print("10"+","+"20");
> saveAs("Text", dir +name + ".csv”);

Upgrade to the latest ImageJ daily build (1.49r24) and this macro code will work as expected.

-wayne

> --
> View this message in context: http://imagej.1557.x6.nabble.com/Saving-Log-window-as-a-csv-file-but-not-a-txt-file-tp5012505.html
> Sent from the ImageJ mailing list archive at Nabble.com.



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

Re: Saving Log window as a csv file but not a txt file

Tomm
Thanks Wayne, I tested the macro using the version you mentioned, but the problem was not solved.
The file that named 'test.csv”); .txt' was saved. I hope you have alternative answer.

Tomm
Reply | Threaded
Open this post in threaded view
|

Re: Saving Log window as a csv file but not a txt file

Jerome Mutterer-3
Hi,
You could save your file as text, and rename it, using *File.rename**(*
*path1**, **path2**)*.
Jerome.
Le 17 avr. 2015 06:41, "Tomm" <[hidden email]> a écrit :

> Thanks Wayne, I tested the macro using the version you mentioned, but the
> problem was not solved.
> The file that named 'test.csv"); .txt' was saved. I hope you have
> alternative answer.
>
> Tomm
>
>
>
> --
> View this message in context:
> http://imagej.1557.x6.nabble.com/Saving-Log-window-as-a-csv-file-but-not-a-txt-file-tp5012505p5012512.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
Reply | Threaded
Open this post in threaded view
|

Re: Saving Log window as a csv file but not a txt file

Tomm
Thanks, Jerome. I got the output I hope!