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

Home » Public Forums » archive » Re: Writing 2D array to Text File
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 2D array to Text File [message #67759 is a reply to message #67757] Fri, 21 August 2009 13:40 Go to previous messageGo to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Aug 21, 4:09 pm, "Jean H." <jghas...@DELTHIS.ucalgary.ANDTHIS.ca>
wrote:
> you can play with the format keyword...
> something like this:
>
> print, a, format='(120(A,","))'     ==> will put a comma after each value
>
> or
>
> print, a, format='(120A)'   ==>will write by 120 cols.
>
> So, in your case, just remove the loops...
>
> PRINTF,lun,array, format = '(120A)'

That is in case it is an array of strings. For numbers you would have
to pick a numeric format in place of the A (I,F,E being the most
common; see the documentation on print, and there will be a link to
the format codes).

That double loop was writing only one element per line because by
default each printf statement moves the output to a new line after it,
so it was putting a newline after each element.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Bus Error on Mac when TVRD() is called in IDL 6.4
Next Topic: Loop Multiple Files and Rename

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

Current Time: Sat Oct 11 14:37:34 PDT 2025

Total time taken to generate the page: 1.59874 seconds