Re: fortran program reading an external text (and numbers) file and writing with edits



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
#***********************************************************

.



Relevant Pages

  • Re: How to stop sections from restarting page numbering?
    ... do this macro. ... >For Each Sect In ActiveDocument.Sections ... > For Each Head In Sect.Headers ... >>the appendices start, it starts again with page 1. ...
    (microsoft.public.word.numbering)
  • Re: activate macro by values in a column
    ... I have a macro that first filters the 2's as you suggested and I have the ... fully understand it but I'm slowly getting my head around it. ... This does work fine other than the activecell is the first row to be ...
    (microsoft.public.excel.programming)
  • Can you help me to improve this macro?
    ... I would like some help to improve the following macro (I am NOT an Excel ... to move the temporary range to another sheet, ... newlist.Cells= head ... tr.Cells(outrow, outcol) = newlist ...
    (microsoft.public.excel.programming)
  • Re: Printing from alternating trays
    ... circumstances is to use a macro to treat each 'letter' as a separate print ... to print pg1 from tray 2 with the letter head and the rest of the ... pages through tray 3 with the plain paper. ...
    (microsoft.public.word.docmanagement)
  • Re: Error when macro is called
    ... Excuse me ... while I kick myself in the head a few times for missing that. ... Anyway, thanks for the slap upside the head, I appologize for my stupididty. ... Ok, reading between the lines here, I guess the macro includes a RunCode ...
    (microsoft.public.access.macros)