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

Home » Public Forums » archive » Formatted Reads of Arrays
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Formatted Reads of Arrays [message #20484] Fri, 30 June 2000 00:00 Go to next message
wcapehar is currently offline  wcapehar
Messages: 12
Registered: May 1998
Junior Member
For ages I have had to use dummy variables to read formatted data into
an array so that, for example,

for a loop value "i"

readf, 1, rplace, rvalue1, rvalue2, rcode1, rcode2, $
format='(A5,F5.3,I6,2A3)'

place(i) = rplace
value1(i) = rvalue1
value2(i) = rvalue2
rcode1(i) = rcode1
rcode1(i) = rcode2

If all the values were the same type, then I could just read them in as
a big array block and then parse with wildcards. But the mix of
characters and integers in this file requires the personal attention.
Are there any tricks to do this more efficiently or at least drop the
dummy variables?

Thanks much...
Bill


Sent via Deja.com http://www.deja.com/
Before you buy.
Re: Formatted Reads of Arrays [message #20559 is a reply to message #20484] Wed, 05 July 2000 00:00 Go to previous message
promashkin is currently offline  promashkin
Messages: 169
Registered: December 1999
Senior Member
Bill,
I think than the simpliest thing to do is to read into strings and
STRSPLIT, then convert data types. I also had success reading into
structures. This works if the last part of lines is characters. If first
fields of a structure are strings, then automated formatting for READF
in IDL reads the whole line into a string and more sophisticated
formatting was required.
Cheers,
Pavel

> But the mix of
> characters and integers in this file requires the personal attention.
> Are there any tricks to do this more efficiently or at least drop the
> dummy variables?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Please repost last week mails about fast spline interpolation
Next Topic: array multiply question

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

Current Time: Wed Dec 03 06:54:18 PST 2025

Total time taken to generate the page: 0.47787 seconds