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

Home » Public Forums » archive » Re: convert very large string to numeric
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: convert very large string to numeric [message #36122 is a reply to message #36119] Mon, 25 August 2003 14:31 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Mirko Vukovic wrote:

> 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

Oh

why did you operate with bytes?

Ok we do it in some cases too.

I would suggest to use bytes2strarr
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/bytes2strarr_dbase.pro.html

to convert the bytes to a stringarray. This means it is not necessary to
convert 9b,10b,13b to 32b.

result is a string array.


From a string array it is easy to read by reads values from strings.


If you original have an ascii file I would suggest to use our
read_data_file.
It has two modes. default is table orientated with the /vstruct keyword you
can change it into column orientated.
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/read_data_file_dbase.pro.html


regards

Reimar


--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
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
Previous Topic: Re: what is an efficient lossless compression way to store a gray-scale image
Next Topic: [HELP] My program is not running in IDL 5.6

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

Current Time: Sun Oct 12 00:20:33 PDT 2025

Total time taken to generate the page: 0.88087 seconds