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

Home » Public Forums » archive » Re: printing comma delimeted file from vectors
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: printing comma delimeted file from vectors [message #82899] Fri, 25 January 2013 14:36 Go to next message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
Take a peak at

http://www.idlcoyote.com/tips/csv_file.html

You'd have to make a 4xn array like so:

IDL> data = [date, time, rhie, cirrusp]

but then you should be directly apply the concepts from the link.
Re: printing comma delimeted file from vectors [message #82900 is a reply to message #82899] Fri, 25 January 2013 14:31 Go to previous messageGo to next message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
On Friday, January 25, 2013 10:25:51 PM UTC+1, justinclouds wrote:
> I have the following vectors (Date, time, rhie, cirrusp) each of the form FLOAT = Array[1, 16595]. The code below puts all the data in one single column (and no commas) instead of 4 comma delimited columns. In the past this has worked for me. Can somebody help with correcting the syntax to produce the 4 comma delimited columns.
>
>
>
> openw, lun, opath+dir+'_kramer4.txt', /get_lun
>
> printf, lun, 'Date, time, rhie, cirrusp'
>
> printf, lun, date,',',time,',',rhie,',',cirrusp
>
> free_lun, lun

You probably got the commas, but you had to scroll down 16595 rows to see the first one.

You could do

for i=0,16594 do printf,lun,date[i],',',time[i],',',rhie[i],',',cirrusp[i]
Re: printing comma delimeted file from vectors [message #82994 is a reply to message #82900] Fri, 25 January 2013 15:21 Go to previous message
justinclouds is currently offline  justinclouds
Messages: 25
Registered: December 2012
Junior Member
On Friday, January 25, 2013 3:31:33 PM UTC-7, Mats Löfdahl wrote:
> On Friday, January 25, 2013 10:25:51 PM UTC+1, justinclouds wrote:
>
>> I have the following vectors (Date, time, rhie, cirrusp) each of the form FLOAT = Array[1, 16595]. The code below puts all the data in one single column (and no commas) instead of 4 comma delimited columns. In the past this has worked for me. Can somebody help with correcting the syntax to produce the 4 comma delimited columns.
>
>>
>
>>
>
>>
>
>> openw, lun, opath+dir+'_kramer4.txt', /get_lun
>
>>
>
>> printf, lun, 'Date, time, rhie, cirrusp'
>
>>
>
>> printf, lun, date,',',time,',',rhie,',',cirrusp
>
>>
>
>> free_lun, lun
>
>
>
> You probably got the commas, but you had to scroll down 16595 rows to see the first one.
>
>
>
> You could do
>
>
>
> for i=0,16594 do printf,lun,date[i],',',time[i],',',rhie[i],',',cirrusp[i]

Thanks! This was very helpful.
Re: printing comma delimeted file from vectors [message #82995 is a reply to message #82899] Fri, 25 January 2013 15:21 Go to previous message
justinclouds is currently offline  justinclouds
Messages: 25
Registered: December 2012
Junior Member
On Friday, January 25, 2013 3:36:55 PM UTC-7, Phillip Bitzer wrote:
> Take a peak at
>
>
>
> http://www.idlcoyote.com/tips/csv_file.html
>
>
>
> You'd have to make a 4xn array like so:
>
>
>
> IDL> data = [date, time, rhie, cirrusp]
>
>
>
> but then you should be directly apply the concepts from the link.

Thanks! This was very helpful.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: autocorrelation help
Next Topic: Re: autocorrelation help

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

Current Time: Wed Oct 08 13:48:49 PDT 2025

Total time taken to generate the page: 0.00643 seconds