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

Home » Public Forums » archive » extract numbers from string
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: extract numbers from string [message #44585 is a reply to message #44518] Wed, 22 June 2005 07:27 Go to previous messageGo to previous message
Norbert Hahn is currently offline  Norbert Hahn
Messages: 46
Registered: May 2003
Member
"Tobi" <tbeetz@yahoo.com> wrote:

> i have a data file with a header that has several lines, which i read
> with
>
> readf,1,firstline
> readf,1,secondline
> ....
>
> firstline is a string that looks like
> xpixels = 1024
>
> i am trying to convert this to a variable called nx which has the value
> 1024.
>
> is there a clean and easy way to do this?

I would use

reads, firstline, nx, format="(9X,I5)"

The format statment cause reads to skip 9 characters and then expect up to 5
digits for an integer number.

HTH
Norbert
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Inverse 3D FFT
Next Topic: Re: Inverse 3D FFT

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

Current Time: Sat Oct 11 14:03:16 PDT 2025

Total time taken to generate the page: 1.12156 seconds