| Re: writing multi-column text files [message #36093] |
Mon, 18 August 2003 10:35 |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
James Bradbury wrote:
>
> I have a simple floating point array
>
> DATA FLOAT = array[17,48]
>
> that I would like to write to a text file.
>
> This is how I am trying to do it:
>
> openW, 1, 'new_data.txt'
> printF, 1, data
> close,1
>
> The problem is that when I open the IDL-written text file outside of
> IDL, it does not have the same dimensions as it should (17 columns,
> and 48 rows). It only has six columns... and 3 times as many rows.
>
> This seems like it should be VERY simple...
Should be. Unfortunately file I/O never is (in any language as far as I can tell :o) The problem is the
default output width of ASCII files. I think it's something like 80-100 columns.
Try
openw, 1, 'new_data.txt', width=2000
This should give you 2000 output columns(characters)...more than enough for 17 data columns.
paulv
--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
Ph: (301)763-8000 x7748
Fax:(301)763-8545
|
|
|
|