newbie's question for writing files [message #53512] |
Tue, 17 April 2007 11:19  |
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  |
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  |
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.")
|
|
|