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

Home » Public Forums » archive » Re: formatting array output?
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: formatting array output? [message #33857 is a reply to message #33855] Thu, 30 January 2003 14:09 Go to previous messageGo to previous message
Murat Maga is currently offline  Murat Maga
Messages: 6
Registered: December 2002
Junior Member
Kenneth Bowman wrote:
>
> In article <3E394CDD.8F9B0C65@mail.utexas.edu>,
> Murat Maga <maga@mail.utexas.edu> wrote:
>
>> Hi All,
>> I have an integer array (2000x1000) which I would like to write in file
>> in the typical matrix convention. I think IDL breaks the line at 80th
>> column and everything starts to look quite messy.
>> To format an array output, do I use the print/printf, or are there any
>> other tricks good to know?
>> Best,
>> Murat
>
> Use a portable binary format like netcdf or hdf. You aren't really
> planning to read the file, are you?
>
> id = NCDF_OPEN('newfile')
> d1 = NCDF_DIMDEF(id, 'dim1', 2000)
> d2 = NCDF_DIMDEF(id, 'dim2', 1000)
> vid = NCDF_VARDEF(id, 'matrix', [d1, d2], /LONG)
> NCDF_CONTROL, id, /ENDEF
> NCDF_VARPUT, id, 'matrix', matrix
> NCDF_CLOSE, id
>
> Ken Bowman

Thanks for the answers everybody. Yes I do need to use an ASCII format,
HDF is not an option for me. I also need to parse the file manually -at
least partially-, that is the other reason.

printf, 2, '$(2000F)'
command is actually all i need. But I have one other silly question,
what if the size of the array is parametric? I tried to put the variable
name but that didnt work. Just for the record, I come from neither C nor
fortran school. No programming skills, unfortunately. I measure bones
:-)
Best,
Murat
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: last array index subscript
Next Topic: Re: Alpha Blending inside of Widgets / Graphic Objects in Widgets

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

Current Time: Sun Nov 30 21:52:15 PST 2025

Total time taken to generate the page: 1.28646 seconds