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

Home » Public Forums » archive » Re: Writing a lot of data to ASCII file without a loop?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Writing a lot of data to ASCII file without a loop? [message #76861 is a reply to message #76860] Tue, 12 July 2011 04:34 Go to previous messageGo to previous message
ben.bighair is currently offline  ben.bighair
Messages: 221
Registered: April 2007
Senior Member
On 7/12/11 7:06 AM, Rob wrote:
> On Jul 12, 11:45 am, Carsten Lechte<c...@toppoint.de> wrote:
>> On 12/07/11 12:11, Rob wrote:
>>
>>> I need to write a large array of values to an ASCII file in two long
>>> columns and wondered if there was a quick way of doing it.
>>
>> Write them as a single array:
>>
>> IDL> s1 = [1,2,3,4]
>> IDL> s2 = [5,6,4,1]
>> IDL> writeit = TRANSPOSE([[s1],[s2]])
>> IDL> print, writeit, format = '(G15.9)'
>> 1.00000000 5.00000000
>> 2.00000000 6.00000000
>> 3.00000000 4.00000000
>> 4.00000000 1.00000000
>>
>> That gets rid of the loop, but still does a lot of binary-to-ascii
>> conversions, so do not expect miracles.
>>
>> chl
>
> That doesn't seem to quite work as it prints one below the other
> rather than in two columns.
>
> e.g. in your example it'd be
>
> 1
> 5
> 2
> 6
> 3
> 4
> 4
> 1
Hi,

I suspect he meant to write...

print, writeit, format = '(2G15.9)'

Note the 2, meaning print output in pairs.

Cheers,
Ben
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Writing a lot of data to ASCII file without a loop?
Next Topic: Re: Ready to quit after 25 years...

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

Current Time: Sun Oct 12 06:01:19 PDT 2025

Total time taken to generate the page: 1.64777 seconds