Re: fortran program reading an external text (and numbers) file and writing with edits
- From: Sharad_Regmi@xxxxxxxxxxx
- Date: 30 Oct 2006 08:27:08 -0800
Tobias wrote:
Hi,
Sharad_Regmi@xxxxxxxxxxx wrote:
I am looking for some guidence in writing a fortran program which reads
an external file (one page consisting of text and numbers) and
printing the same file (with different name) with some edits.
Can this be done in fortran 90/95? Help appriciated,
Yes it can, however, depending what you want to change and how the text
and numbers are saved, you should better use another programming
language. Especially for heavy string modifications, I think, other
languages are better suited, even though it can be done in Fortran.
Could you give an example (or explain in more details) how a line in
your file looks like and how you want to modify it? Then we can give
you tips how to do it in Fortran. (And/or to advise you not to do it in
Fortran.)
Tobias
Tobias,
Thank you for your response.
My file looks like this; I will have to change some numbers (not text)
and write the file with a different name.
-------------------------------------------------------------------------------------------------------------------------------
#The rock macro assigns values of rock density, specific heat, and
#porosity.
rock
1 22491 1 2300. 1010. 1.0
22492 67473 1 2300. 1010. 0.12
#***********************************************************
perm
1 22491 1 6.793e-12 6.793e-12 6.793e-13
22492 67473 1 1.019e-12 1.019e-12 1.019e-13
#***********************************************************
#The pres macro assigns initial values of pressure
#temperature, and defines thermodynamic region. pres
1 0 0 2.0 22.0 1
#***********************************************************
#The head macro enables the entry (in flow or pres macros) and output
#of hydraulic head instead of pressure.
head
#***********************************************************
#The airwater macro limits the solution to isothermal conditions with
#two-phase flow. air
3
22.0 0.1
#***********************************************************
.
- Follow-Ups:
- References:
- Prev by Date: Re: fortran program reading an external text (and numbers) file and writing with edits
- Next by Date: Re: io-unit has been opened
- Previous by thread: Re: fortran program reading an external text (and numbers) file and writing with edits
- Next by thread: Re: fortran program reading an external text (and numbers) file and writing with edits
- Index(es):
Relevant Pages
|