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

Home » Public Forums » archive » Re: reading in a long line of 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 in a long line of data [message #60282 is a reply to message #60281] Thu, 08 May 2008 09:38 Go to previous message
ben.bighair is currently offline  ben.bighair
Messages: 221
Registered: April 2007
Senior Member
On May 8, 12:18 pm, te...@atmsci.msrc.sunysb.edu wrote:
> Hi, I am trying to read in a long line which has around 2520 values
> all in scientific notation (ie 1.2E+02, etc). I tried the following:
>
> x=strarr(2520)
> x[*]='12345678'
> readu,unit,x
>
> Then converting to floating point. This doesn't seem to work since
> the data is in scientific notation. Does anyone have any suggestions?
>

Hi,

The easiest way might be the following...

x = ""
READF, U, x
x = FLOAT(STRSPLIT(x, ",",/EXTRACT))

which assumes comma delimited data.

If you know exactly how many items are in a row you can get fancier
with explicit format statements. But this simpler form should be OK.

Cheers,
Ben
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: storing in array
Next Topic: How to HIDE a WIDGET_BUTTON and dont hide the widget hierarchy ?

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

Current Time: Fri Oct 10 14:06:45 PDT 2025

Total time taken to generate the page: 1.27490 seconds