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

Home » Public Forums » archive » converting to array
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
converting to array [message #24151] Mon, 12 March 2001 11:41 Go to next message
Martin Skou Andersen is currently offline  Martin Skou Andersen
Messages: 5
Registered: December 2000
Junior Member
Hi...
I have some data from a file...
example:
file start
10.5 30.5 40.8 57.9 90.8

end of file
I would like to read these data from a file, and these should be placed
in a array...
But when I read the file the datas are placed in a string. How do i get
these data converted to a array?

Thanx
Martin Skou
Re: converting to array [message #24358 is a reply to message #24151] Mon, 26 March 2001 12:14 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Martin Skou Andersen wrote:
>
> Hi...
> I have some data from a file...
> example:
> file start
> 10.5 30.5 40.8 57.9 90.8
>
> end of file
> I would like to read these data from a file, and these should be placed
> in a array...
> But when I read the file the datas are placed in a string. How do i get
> these data converted to a array?
>
> Thanx
> Martin Skou

Dear Martin,

We have a general routine which reads automaticly array orientated files
like


HEADER
HEADER
COLUMN1 COLUMN2 COLUMN3 COLUMN4 COLUMN5
10.5 30.5 40.8 57.9 90.8
10.5 30.5 40.8 57.9 90.8
10.5 30.5 40.8 57.9 90.8
TRAILER
TRAILER



You can have as much header or trailer comments you like. This routines
founds automaticly where the data starts and where the data is finished.

result=read_data_file(file.txt)

The result could have these tags

header
separator
data
trailer

The data tag is an array of columns, lines. The type could be set.
A widget to look at the data could be called by a keyword.


http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/read_data_file.tar.gz


For further routines and licensing please look at
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml


regards
Reimar


--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg1/
=============================================
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml

http://www.fz-juelich.de/zb/text/publikation/juel3786.html
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: line graph problems
Next Topic: widget fonts

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

Current Time: Wed Oct 08 14:52:42 PDT 2025

Total time taken to generate the page: 0.00515 seconds