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

Home » Public Forums » archive » Re: Import .csv files
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: Import .csv files [message #45228] Fri, 19 August 2005 03:56
Marc Reinig is currently offline  Marc Reinig
Messages: 30
Registered: June 2004
Member
Davis is absolutely right, just check the file once again. If you
are looking for a particular code, I would advise you to have a look
here:

http://idlastro.gsfc.nasa.gov/ftp/pro/misc/readcol.pro

Cheers,
Yuri

On Thu, 18 Aug 2005 17:18:28 +0200, S.Cogliati
<cogliati.sergio@fastwebnet.it> wrote:

> Hallo, I have a little problem to import some ".csv" data file,
> these files are output from another Idl routine and they contain one
> record header whit the columns title while the other fields are a
> numerical matrix of 5 columns and 751 records.
> I always performed it in this way:
>
> str=''
> tmp=fltarr(5,751)
> openr,lun, 'file_name',/get_lun
> readf,lun,str
> readf,lun,tmp
> free_lun,lun
> .......
>
> But in this case Idl stops at the 'readf,lun,tmp' instruction with
> the following error message: "% READF: End of file encountered. Unit:
> 102, File: C:\029_0730_trifogli_ref.csv'
>
> Can you advise me why happen this and suggest me the right idl code for
> import these files?
>
> Thank you
> Sergio
>
> Cogliati.sergio@fastwebnet.it
>
Re: Import .csv files [message #45233 is a reply to message #45228] Thu, 18 August 2005 09:06 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
S.Cogliati writes:

> Hallo, I have a little problem to import some ".csv" data file,
> these files are output from another Idl routine and they contain one
> record header whit the columns title while the other fields are a
> numerical matrix of 5 columns and 751 records.
> I always performed it in this way:
>
> str=''
> tmp=fltarr(5,751)
> openr,lun, 'file_name',/get_lun
> readf,lun,str
> readf,lun,tmp
> free_lun,lun
> .......
>
> But in this case Idl stops at the 'readf,lun,tmp' instruction with
> the following error message: "% READF: End of file encountered. Unit:
> 102, File: C:\029_0730_trifogli_ref.csv'
>
> Can you advise me why happen this and suggest me the right idl code for
> import these files?

It seems likely to me that your file doesn't contain what you
think it contains. Can you open it in a text editor to confirm?

Sometimes this error comes about because the very last line
in the file didn't get a Carriage Return associated with it
and IDL needs it to count properly.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Breakpoints in IDL 6.2 (windows)
Next Topic: widgets

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

Current Time: Wed Oct 08 17:34:49 PDT 2025

Total time taken to generate the page: 0.00732 seconds