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

Home » Public Forums » archive » Re: newbie's question for writing files
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: newbie's question for writing files [message #53511 is a reply to message #53510] Tue, 17 April 2007 13:19 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
geonline714@gmail.com writes:

> I have a question that need your kind help:
>
> I have an arrary X with 101 columns and want to output the first
> column to integer format and the rest 100 columns to float format:
>
> OPENW,1,'test.txt'
> printf, 1, X, format='(I0,100(2X,:,F0))'
> close, 1
>
> However, because I used the group specification, format control
> reverts to the group repeat specification whose opening parenthesis
> matches the next-to-last closing parenthesis of the format string. So,
> the data are output to float format except the first line. Would you
> please give me some advices for fixing this problem? Thanks
>
> Maybe I cannot use group specification here.

Just throw in an extra set of parentheses. :-)

printf, 1, X, format='((I0,100(2X,:,F0)))'

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: 3D congrid without interpolation
Next Topic: Disavow Any Inaccuracies

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

Current Time: Thu Oct 09 23:23:13 PDT 2025

Total time taken to generate the page: 0.64343 seconds