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 #56237 is a reply to message #56236] Wed, 10 October 2007 08:08 Go to previous messageGo to previous message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
I am assuming you have tried this and got this error:
% READF: Input conversion error. Unit: 101, File: data.txt
% Execution halted at: $MAIN$

the issue is that you have to initialize read variables to strings if
you want to read strings.


this is the code I used:
IDL> openr, lun, 'data.txt', /get_lun
IDL> readf, lun, in1
IDL> readf, lun, in2
IDL> readf, lun, in3
IDL> in4 = ''
IDL> readf, lun, in4
IDL> help, in1, in2, in3, in4
IN1 FLOAT = 650.000
IN2 FLOAT = 550.000
IN3 FLOAT = 480.000
IN4 STRING = 'chimeny.sav '




Cheers,

Brian

------------------------------------------------------------ ---------------------
Brian Larsen
Boston University
Center for Space Physics
[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: Thu Oct 23 03:36:55 PDT 2025

Total time taken to generate the page: 0.25397 seconds