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

Home » Public Forums » archive » Re: String Data file
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: String Data file [message #35857 is a reply to message #35849] Thu, 31 July 2003 00:02 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Karthikayan Balakrishnan wrote:
> Hello All,
> I have a data file that looks like this:
> abc 1 2
> def 3 4.5
> ghij 2.3 23.44
> ...
> ...
> The first column is string, the next two are
> floating point. Is there any way I can read such a file?
> I am familiar with counting the number of rows and reading
> data file with just numbers, but this combination of numbers
> and strings is too much for me.
>
> Thanks in advance,
> Karthik.

Our published read_date_file with the /vstruct keyword does not read
this file.
x=read_data_file('file.txt',/vstruct)

I missed to include first column of text type. I have fixed this in our
working library. Now I am testing the whole thing.

help,x.data,/str
** Structure <83892dc>, 3 tags, length=20, data length=20, refs=2:
VAR0 STRING 'abc'
VAR1 FLOAT 1.00000
VAR2 FLOAT 2.00000

help,x.data[1],/str
** Structure <83892dc>, 3 tags, length=20, data length=20, refs=2:
VAR0 STRING 'def'
VAR1 FLOAT 3.00000
VAR2 FLOAT 4.50000

help,x.data[2],/str
** Structure <83892dc>, 3 tags, length=20, data length=20, refs=2:
VAR0 STRING 'ghij'
VAR1 FLOAT 2.30000
VAR2 FLOAT 23.4400

If you are interested I can sent a separate copy of the changed files.

Reimar


--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: BOX_CURSOR
Next Topic: minor glitch in total()

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

Current Time: Wed Oct 08 18:44:45 PDT 2025

Total time taken to generate the page: 0.00396 seconds