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

Home » Public Forums » archive » Re: Reading and saving 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: Reading and saving a file [message #74645 is a reply to message #74643] Wed, 26 January 2011 05:52 Go to previous messageGo to previous message
Gray is currently offline  Gray
Messages: 253
Registered: February 2010
Senior Member
On Jan 26, 8:25 am, Giovanna <giovanna01.san...@gmail.com> wrote:
> Hi all,
>
> I need to read and save a file using IDL, but my code is reading and
> saving only the first line. Please, see my code:
>
> PRO READ_FILE
> OpenR, lun, 'C:\Documents and Settings\Web\IDLWorkspace\Projeto_Estudo
> \dados.dat', /Get_lun
> file = ''
> ReadF, lun, file
> SAVE, FILENAME=('C:\Documents and Settings\Web\IDLWorkspace
> \Projeto_Estudo\teste1.dat')
>
> ;print,file
> END

It reads in the first line because "file" is a string, and not a
string array. If you want the whole thing you need:

file = strarr(file_lines(...))
readf, lun, file
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: configuration file to go along with a virtual machine program
Next Topic: MATRIX LOGARITHM (and EXPONENTIAL)

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

Current Time: Fri Oct 10 04:31:24 PDT 2025

Total time taken to generate the page: 0.55927 seconds