Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
values in file
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Elaheh  
View profile  
 More options Nov 7, 2:34 am
Newsgroups: comp.lang.fortran
From: Elaheh <elaheh.ad...@gmail.com>
Date: Fri, 6 Nov 2009 23:34:27 -0800 (PST)
Local: Sat, Nov 7 2009 2:34 am
Subject: values in file
Hi,
I use a file in my code (in fortran90) by using “open
( 10,file=’data’)”, that have saved an array in this file. I want to
clean values in this file and save another array at file, during
running of my code.

How can I do this
work?
Thanks in advance.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
fj  
View profile  
 More options Nov 7, 5:32 am
Newsgroups: comp.lang.fortran
From: fj <francois.j...@irsn.fr>
Date: Sat, 7 Nov 2009 02:32:45 -0800 (PST)
Local: Sat, Nov 7 2009 5:32 am
Subject: Re: values in file
On 7 nov, 08:34, Elaheh <elaheh.ad...@gmail.com> wrote:

> Hi,
> I use a file in my code (in fortran90) by using “open
> ( 10,file=’data’)”, that have saved an array in this file. I want to
> clean values in this file and save another array at file, during
> running of my code.

> How can I do this
> work?
> Thanks in advance.

Apparently, you just need to rewind the file with the instruction :

REWIND(10)

After that, you can write something else in the file 10 (these WRITE
statements will overwrite the previous contents).


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
SimonG  
View profile  
 More options Nov 9, 4:43 am
Newsgroups: comp.lang.fortran
From: SimonG <si...@whiteowl.co.uk>
Date: Mon, 9 Nov 2009 01:43:33 -0800 (PST)
Local: Mon, Nov 9 2009 4:43 am
Subject: Re: values in file
On Nov 7, 10:32 am, fj <francois.j...@irsn.fr> wrote:

But if you don't write as many values I don't think that all the old
ones will be deleted. A safer way would be to close and reopen the
file as a replacement:

close(10)
open(10,file='data',status='replace')

Simon


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
fj  
View profile  
 More options Nov 9, 9:21 am
Newsgroups: comp.lang.fortran
From: fj <francois.j...@irsn.fr>
Date: Mon, 9 Nov 2009 06:21:48 -0800 (PST)
Local: Mon, Nov 9 2009 9:21 am
Subject: Re: values in file
On 9 nov, 10:43, SimonG <si...@whiteowl.co.uk> wrote:

No, the old values will be entirely deleted because a final CLOSE(10)
will be executed automatically at the end of the run, fixing the new
file end position.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
fj  
View profile  
 More options Nov 9, 9:49 am
Newsgroups: comp.lang.fortran
From: fj <francois.j...@irsn.fr>
Date: Mon, 9 Nov 2009 06:49:21 -0800 (PST)
Local: Mon, Nov 9 2009 9:49 am
Subject: Re: values in file
On 9 nov, 15:21, fj <francois.j...@irsn.fr> wrote:

I forgot the key point : this new file end position is always located
just after the last written record (if no WRITE statement occurs, then
the old file end position remains unchanged).

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Terence  
View profile  
 More options Nov 9, 10:46 pm
Newsgroups: comp.lang.fortran
From: Terence <tbwri...@cantv.net>
Date: Mon, 9 Nov 2009 19:46:37 -0800 (PST)
Local: Mon, Nov 9 2009 10:46 pm
Subject: Re: values in file
Better still is to first read the NEW file and write a NEW one, then
at the end of the program,
EITHER
  call funtions to save the old file with a new name and rename the
new file with the original name,
OR,
  copy the OLD file to a back-up named file, and then copy the new
FILE OVER the old FILE (by opening the old file and writing to it).

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google