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 #76863 is a reply to message #76862] Tue, 12 July 2011 04:06 Go to previous messageGo to previous message
rjp23 is currently offline  rjp23
Messages: 97
Registered: June 2010
Member
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
[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: Sat Oct 11 07:01:27 PDT 2025

Total time taken to generate the page: 0.32169 seconds