comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Formatting WRITE_CSV output
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Formatting WRITE_CSV output [message #70888] Thu, 13 May 2010 12:45
fgg is currently offline  fgg
Messages: 67
Registered: April 2010
Member
> Not directly. If your data are strings, you can format them first,
> then give them to write_csv, such as
>
> write_csv,file,string(data1,format=...),string(data2,format= ...)
>
> But write_csv encapsulates strings in quotes, which is probably
> undesirable if your data were not strings.
>
> So it is probably better to use plain old printf with the format you
> want plus the commas to separate the fields.


Thanks, pp. I guess I'll go with printf. Another disadvantage of
write_csv is that it limits the number of output columns to 8.
Re: Formatting WRITE_CSV output [message #70896 is a reply to message #70888] Wed, 12 May 2010 18:32 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On May 12, 10:00 pm, fgg <fabioguimaraesgoncal...@gmail.com> wrote:
> Hi,
>
> Is it possible to use format codes with WRITE_CSV? In other words, can
> I specify the output format for each "Data" below?
>
> WRITE_CSV, Filename, Data1  [, Data2,..., Data8] [, HEADER=variable]
>
>  Thank you!

Not directly. If your data are strings, you can format them first,
then give them to write_csv, such as

write_csv,file,string(data1,format=...),string(data2,format= ...)

But write_csv encapsulates strings in quotes, which is probably
undesirable if your data were not strings.

So it is probably better to use plain old printf with the format you
want plus the commas to separate the fields.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Help on EDGE_DOG
Next Topic: quit/close events on mac

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:30:01 PDT 2025

Total time taken to generate the page: 0.00491 seconds