Re: easy read of column ASCII file in IDL? [message #12709] |
Fri, 28 August 1998 00:00  |
Paul van Delst
Messages: 364 Registered: March 1997
|
Senior Member |
|
|
Liam Gumley wrote:
> Peter Clinch wrote:
>> I'm just evaluating IDL as the UK agents are offering a very good
>> "Abandon PV~Wave in favour of IDL" offer.
>> In Wave, we often use DC_READ_FREE with the /col keyword to read column
>> form,atted ASCII data: is there a similarly easy way to do this in IDL?
>
> We swear by DDREAD, a utility developed by Fred Knight. Check out
>
> ftp://ftp.rsinc.com/pub/user_contrib/knight/
>
> From the in-line documentation:
> ; This routine reads data in formatted (or unformatted) rows and
> columns.
> ; The name stands for Data Dump Read. By default, comments are
> ; skipped and the number of columns is sensed. Many options
> ; exist, e.g., selecting rows and columns, reading binary data,
> ; and selecting non-default data type and delimiters.
>
> Cheers,
> Liam.
I agree with Liam - DDREAD makes reading ASCII column data trivial. However,
DDREAD does use another user contribution routine called N_LINES.PRO (or
NLINES.PRO..can't remeber which) in where the total number of lines is
initially set to zero:
n_lines = 0
which can cause consternation if you're reading a large ASCII file. The
definition should be
n_lines = 0L
Just so you know.
paulv
--
Paul van Delst
Space Science and Engineering Center "Religious and cultural
University of Wisconsin-Madison purity is a fundamentalist
1225 W. Dayton St., Madison WI 53706 fantasy"
Ph/Fax: (608) 265-5357, 262-5974 V.S. Naipaul
Email: paul.vandelst@ssec.wisc.edu
Web: http://airs2.ssec.wisc.edu/~paulv
|
|
|