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

Home » Public Forums » archive » read_ascii
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
read_ascii [message #41756] Wed, 08 December 2004 12:47 Go to next message
fleduc is currently offline  fleduc
Messages: 7
Registered: December 2004
Junior Member
Hello,

I use the following code to read an ascii file:
> filename = dialog_pickfile(path='c:\')
> data = READ_ASCII(filename, DATA_START=1, DELIMITER= ',')
> data = data.field1

I want data to become an array instead of a structure.

The problem is that sometimes the array is contained in field01,
sometimes in field01.
How come it varies ?

Thanks,

Francois.
Re: read_ascii [message #43198 is a reply to message #41756] Fri, 25 March 2005 08:35 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Matthias Demuzere wrote:

> Hi,
>
> I have a large ascii file that I read in with the command read-ascii. Now
> a gave a name to each column of that file.
> My problem is to select just a part of this ascii file that looks for
> example like this:
>
> Code Parameter Date Value
> 400 1 01 01 2002 10
> ....... ....
> 31 12 2002 15
> 2 01 01 2002 3
> ....... ....
> 31 12 2002 6
> .... .... .....
> 407 .....
>
> and so one for other CODEs.....
>
> Now i want to select the data for each code (e.g. 400), and in this
> result, i want to sort the data for each parameter (e.g. 2) ....
>
> Can anyone give me a basic solution to this problem?
> Thank you!!
> Matthias
> .

Dear Matthias

what do you mean by large?

Probably you could write your own simple reading routine for this problem.

Probably you could use the `where` function to get returned the indexes of
the submitted code. This index vector could be used to separate a part of
the structure
Afterwards you use `sort` for the parameter to get a second index vetor.

cheers

Reimar

--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
Re: read_ascii [message #43201 is a reply to message #41756] Fri, 25 March 2005 05:08 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Matthias Demuzere writes:

> My problem is to select just a part of this ascii file that looks for
> example like this:
>
> Code Parameter Date Value
> 400 1 01 01 2002 10
> ....... ....
> 31 12 2002 15
> 2 01 01 2002 3
> ....... ....
> 31 12 2002 6
> .... .... .....
> 407 .....
>
> and so one for other CODEs.....

Oh, dear. Any chance you can get this into XML? :-(

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: read_ascii
Next Topic: getting y Coordinates of NetCDF file

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

Current Time: Thu Oct 09 14:54:32 PDT 2025

Total time taken to generate the page: 1.03852 seconds