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

Home » Public Forums » archive » Re: Skipping a line while reading a file.
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: Skipping a line while reading a file. [message #15545] Fri, 21 May 1999 00:00 Go to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
DBorland wrote:
>
> Greetings,
> I am trying to read in some data from a file, and there is a blank line in
> the file. This would not be a problem if the next line I needed to read was
> not a string. Is there any way to have idl skip a line while reading a
> file?
> Here is an example of the data file:
> [... snipped]

> and I am reading it in with the following:
> for i = 0, n-1 do begin
> readf,lun,index,hex_address,angle,magnitude,potential,area
> readf,lun,location
> readf,lun,outward_normal
> readf,lun,address
> : : :
> endfor
>
apparently you don't assign any variable type before you read them. This
can cause all sorts of trouble. As David suggested, you can (only !)
read a string variable if you let IDL know beforehand that it has to
expect a string:
line = ''
readf,lun,line
Careful also with long integers! It never hurts to write
number = 0L
readf,lun,number


... maybe IDL should have an IMPLICIT NONE option ??

Regards,
Martin


--

|||||||||||||||\\\\\\\\\\\\\-------------------///////////// //|||||||||||||||
Martin Schultz, DEAS, Harvard University, 29 Oxford St., Pierce 109,
Cambridge, MA 02138 phone (617) 496 8318 fax (617) 495 4551
e-mail mgs@io.harvard.edu web http://www-as/people/staff/mgs/
[Message index]
 
Read Message
Read Message
Previous Topic: 3D Puzzle
Next Topic: Help

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

Current Time: Sun Oct 12 07:22:18 PDT 2025

Total time taken to generate the page: 1.44260 seconds