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

Home » Public Forums » archive » newbie's question for writing files
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
newbie's question for writing files [message #53512] Tue, 17 April 2007 11:19 Go to next message
geonline714 is currently offline  geonline714
Messages: 7
Registered: April 2007
Junior Member
Dear all,

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.
Re: newbie's question for writing files [message #53696 is a reply to message #53512] Wed, 25 April 2007 09:13 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
JD Smith writes:

> This was a new trick for me... I end up with various loops to do
> things like this. Any chance of putting it together into a tutorial?

Well, yikes! When I sat down to write an article about this
I found Coyote had already written something and put it on
my web site without my noticing:

http://www.dfanning.com/fileio_tips/repeatfmt.html

Cheers,

David

P.S. Since that article doesn't really have Coyote's, uh,
*flair*, it may be I wrote it and then forgot about it. :-(

--
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.")
Re: newbie's question for writing files [message #53725 is a reply to message #53512] Mon, 23 April 2007 11:44 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
JD Smith writes:

> This was a new trick for me... I end up with various loops to do
> things like this. Any chance of putting it together into a tutorial?

I'm pretty jammed up this week, what with preparing a new
IEPA exam and all, but I'll put it on the list. :-)

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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL segfault - debian+variants - libx11-6 client lib
Next Topic: long subscript...

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

Current Time: Wed Oct 08 17:24:49 PDT 2025

Total time taken to generate the page: 0.01046 seconds