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

Home » Public Forums » archive » Re: Reading a set of data with string type entries
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: Reading a set of data with string type entries [message #57072 is a reply to message #57039] Fri, 30 November 2007 05:08 Go to previous messageGo to previous message
Peter Clinch is currently offline  Peter Clinch
Messages: 98
Registered: April 1996
Member
mystea wrote:
> I need to read in a large set of data. Each entry is started with a
> name, followed by many numbers.
> The numbers are separated by spaces, but the length of each number is
> not fixed.
>
> My problem is like this: Since the data starts with a string, I can't
> use free-format readf (because by default, the string slot will read
> the whole line.) and due to the unknown length of numbers, I can't use
> a format code, either.
>
> What should I do?

In this sort of situation I usually write a quick hack in Perl to turn
the input file into something that's easy to process. Perl deals with
any text you can find pretty much /any/ pattern in remarkably well and
it's often easier to pre-process that and leave IDL for the pictures and
number crunching.

(Also very handy for going through verbose data files and binning all
the shite you're not interested in before you read it into IDL)

Pete.
--
Peter Clinch Medical Physics IT Officer
Tel 44 1382 660111 ext. 33637 Univ. of Dundee, Ninewells Hospital
Fax 44 1382 640177 Dundee DD1 9SY Scotland UK
net p.j.clinch@dundee.ac.uk http://www.dundee.ac.uk/~pjclinch/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: about widgets
Next Topic: Re: IDL 7.0 .... any new functions?

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

Current Time: Wed Oct 08 19:31:27 PDT 2025

Total time taken to generate the page: 0.00433 seconds