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

Home » Public Forums » archive » Reading tab delimited string data
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
Reading tab delimited string data [message #21998] Thu, 12 October 2000 00:00
Andy Loughe is currently offline  Andy Loughe
Messages: 174
Registered: November 1995
Senior Member
Hello,

I have some output from a MySQL dump that looks like this...

id date height coverage yy yn ny nn
1388 2000-07-01 all all 114 404 240 28452
1388 2000-07-01 all low 114 404 240 28452
1388 2000-07-01 high all 114 404 240 28452
1388 2000-07-01 all all 114 404 240 28452

I get the data into IDL via this command...

spawn, 'mysql < sql_script.sql', data
IDL> help, data
DATA STRING = Array[5] ; 5 rows of string data (tabs inserted).

Basically, I am working with tab delimited data with a varying number
of columns and a varying number of rows, depending upon the sql query.

I am able to store the data from each column into a separate IDL vector,
id=[ ] date=[ ] height=[ ] , etc. but the approach is to LOOP
through all rows, do a str_sep(row, string(9B)), and then direct the
result into the proper index of the IDL vector.

Looping through all the rows and manipulating each line of string data
can't be the fastest approach. Can someone suggest a faster method?

I thought of ASSOC, and also wondered about str_sep on arrays,
or maybe some of the new str routines. Any thoughts?

Your kind suggestions are appreciated.

--
Andrew Loughe =====================================================
NOAA/OAR/FSL/AD R/FS5 | email: loughe@fsl.noaa.gov
325 Broadway | wwweb: www-ad.fsl.noaa.gov/users/loughe
Boulder, CO 80305-3328 | phone: 303-497-6211 fax: 303-497-6301
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: obj graphics fly-thru help
Next Topic: Problems with IDL call_external to C shared object

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

Current Time: Fri Oct 10 14:29:19 PDT 2025

Total time taken to generate the page: 0.48007 seconds