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

Home » Public Forums » archive » convert very large string to numeric
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
convert very large string to numeric [message #36124] Mon, 25 August 2003 13:58
mvukovic is currently offline  mvukovic
Messages: 63
Registered: July 1998
Member
Hello,

I have a large two column matrix stored as a string, and I want to
convert it to a two column float matrix.

I've been using a rather convoluted method of flattening out the
string matrix by replacing end-of-lines with spaces (having converted
to byte array first), and then using ParseLine (from David F.'s web
site) to get a vector of numbers:


ByteBuffer = byte(self.CharBuffer)
iSubs = where( (ByteBuffer eq 9b) or $
(ByteBuffer eq 10b) or $
(ByteBuffer eq 13b), cSubs)
if cSubs ne 0 then begin
ByteBuffer[iSubs] = 32b
endif

... etc

However, the ParseLine is rather slow for my large set of numbers. I
suspect the reason is that it uses rather pedestrian and string
oriented methods such as strpos and strmid.

Before I go and re-implement ParseLine by converting the string to a
byte type and using where's to delimit numbers, I was wondering
whether anyone might have done that already.

Thanks,

Mirko
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Is there a timer function besides in widget control?
Next Topic: Re: what is an efficient lossless compression way to store a gray-scale image

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

Current Time: Wed Oct 08 13:17:39 PDT 2025

Total time taken to generate the page: 0.00479 seconds