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

Home » Public Forums » archive » Re: Simple text file reading question
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: Simple text file reading question [message #56238 is a reply to message #56237] Wed, 10 October 2007 08:04 Go to previous message
enod is currently offline  enod
Messages: 41
Registered: November 2004
Member
On Oct 10, 10:25 pm, "rpert...@gmail.com" <rpert...@gmail.com> wrote:
> Hi,
> I need to read a text file and assign the strings (and numbers) I read
> to variables.
> My text file contains:
>
> data.txt
> 650
> 550
> 480
> chimeny.sav
>
> I need to assign the first 3 numbers to 3 variables and the string to
> another variable.
>
> Any help?
>
> Thanks,
> RP

Just open it and read line by line.

PRO data_read
OPENR, lun, 'data.txt', /GET_LUN
tmp=''
readf, lun, tmp
int1 = fix(tmp)
readf, lun, tmp
int2 = fix(tmp)
readf, lun, tmp
int3 = fix(tmp)
readf, lun, tmp
str = tmp
FREE_LUN, lun
END


Regards,
Tian
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: 3D registration
Next Topic: Minor IDL code changes cause large slowdowns elsewhere in code

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

Current Time: Mon Dec 01 02:45:38 PST 2025

Total time taken to generate the page: 0.24160 seconds