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

Home » Public Forums » archive » read a file written in fortran
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: Read a file [message #74687 is a reply to message #71186] Fri, 28 January 2011 07:26 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Jan 28, 12:50 pm, Giovanna <giovanna01.san...@gmail.com> wrote:
> Hello,
>
> Me again....
>
> I'm trying read two files and to save in other file. See my code:http://pastebin.com/GRmNtags
>
> I run a command restore, to restore the file .sav and .cnj.... and
> then saved in 'data.dat' using 'printF'
>
> Is this correct what I did in rows 16 to 23??

Semantically, the code is correct, assuming that you have a structure
named modelo with a field name imag, and a structure named conjugado
with a field name imag. It is up to you to say if that is correct in
the sense of producing the file you wanted.

Though I do not see why do

modelo.imag=[MODELO.imag]
conjugado.imag=[CONJUGADO.imag]

Which does not change these variables.

However, there is an oddity coming before those lines: You first read
file.sav as a text file, into a string array. Then you restore it
(that is, read it as an IDL savefile). If it is a text file, the
restore will fail. And if it is a savefile, the read into a string
array, done that way, will probably read some (maybe all) of the file,
but the contents of the string array will be the bytes of the (binary)
savefile, interpreted as characters, which is going to be hard to make
sense of.

Also, you open file2.cnj, and never close it (never even use it). And,
as mentioned before, closing the unit opened with /get_lun to openw
does not release the unit number back into the pool (which a free_lun
would do).

The main question to me is: what do you want to be in the file you are
creating? To say it another way: what should the file look like?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Coyote Graphics Update 30 Jan 2011
Next Topic: Re: Y2 axis title orientation

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

Current Time: Wed Oct 08 23:14:20 PDT 2025

Total time taken to generate the page: 0.39983 seconds