Printing multiple columns in IDL [message #61809] |
Wed, 30 July 2008 19:18  |
Ying Wu
Messages: 2 Registered: July 2008
|
Junior Member |
|
|
Hello all, I'm having a problem with printing multiple columns in
IDL. The data I want to print to text is 300 columns, with 141 rows.
Right now it's printing them all out stacked on top of each other in
one column.
|
|
|
Re: Printing multiple columns in IDL [message #61918 is a reply to message #61809] |
Fri, 01 August 2008 08:03  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Joost Aan de Brugh writes:
> It is becoming more and more ironic. I tried Width=width + 2 and it
> works. But of course, that does not solve the problem. It only removed
> the symptom. Then I used the format statement.
>
> datalength = N_Elements(data[*,0])
> printf,lun,data,format=strjoin(['(',strtrim(string(datalengt h),
> 2),'G16.8))'])
> ; The format should make no sense because it is equal to the default
> format for the double array.
>
> Though it should make no sense, it works
Well, I don't know. I suspected extra spaces that you
weren't accounting for, so the width+2 thing doesn't
surprise me as much as it does you. I think the extra
space is confirmed by the fact that the format statement
works with the original width. That is, your assumption
that the default format is the same as exactly 16*num
spaces is probably incorrect, no matter what it looks like. :-)
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.")
|
|
|