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

Home » Public Forums » archive » Re: reading in tab-separated string data
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: reading in tab-separated string data [message #79863] Thu, 19 April 2012 05:45
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
timbovaird@hotmail.com writes:

> The .dat file opens in excel fine but I always get "READF: End of file
> encountered." when I try to read the table back into IDL. I have a
> similar table which uses floats instead of strings and it works fine
> so I'm not sure what is causing the problem.

The problem is that READF without a format statement
starts reading a string and reads to the end of the line.
It has no way of knowing when the string ends. So,
if you are putting five of these strings on each line,
IDL is reading this in a single line. Thus, you tell
IDL to read 5 "things", it gobbles all the data up
in 1 read, and then complains to you that it encountered
the end of the file before finishing its job.

The solution will be to come up with some kind of
format statement, if possible with this data. Or,
you will have to read each line and separate that
line into individual values (with READS or StrSplit,
probably).

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Borrowed license and batch mode
Next Topic: PyMOL in IDL

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

Current Time: Wed Oct 08 15:52:52 PDT 2025

Total time taken to generate the page: 0.00481 seconds