[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: converting to array



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.html


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.html

http://www.fz-juelich.de/zb/text/publikation/juel3786.html