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

Home » Public Forums » archive » Re: Reading tab delimited string data
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: Reading tab delimited string data [message #21985] Fri, 13 October 2000 00:00 Go to previous message
Ivan Zimine is currently offline  Ivan Zimine
Messages: 40
Registered: February 1999
Member
Andy Loughe wrote:
>
> 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.
>

Just a thought...
If you have many rows and not so many cols make MySQL do the work
IDL> spawn, 'mysql < get_id.sql', id
IDL> spawn, 'mysql < get_date.sql', date
...

--
Ivan Zimine | ivan.zimine@physics.unige.ch
Dpt. of Radiology | (+41 22) 372 70 70
Geneva University Hospitals |
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Problems with IDL call_external to C shared object
Next Topic: Re: obj graphics fly-thru help

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

Current Time: Fri Oct 10 13:27:28 PDT 2025

Total time taken to generate the page: 0.84625 seconds