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 #74686 is a reply to message #71186] Fri, 28 January 2011 08:17 Go to previous messageGo to previous message
Giovanna is currently offline  Giovanna
Messages: 12
Registered: January 2011
Junior Member
On 28 jan, 13:26, Paulo Penteado <pp.pente...@gmail.com> wrote:
> 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?

Well...

I need to read a file file.sav and file1.cnj, then i need restore and
to get the structures modelo.imag, conjugado.imag. And to save in the
new file - data.dat(line 16).

I don't know how to take these structures(modelo.imag, conjugado.imag)
and save in this file data.dat

CAn you help me.??

My code: http://pastebin.com/GRmNtags
[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: Fri Oct 10 03:39:46 PDT 2025

Total time taken to generate the page: 7.20318 seconds