Re: File reading problem



Hello
This is to message 6. Of course the software contains a routine to
read these files. If not to use anything else but this software of
mine written in 1992, there is no problem. It writes, it reads and
does everything in between.

Problems start when users try to do anything not included into the
package. Also, the software is DOS based, very out-of-date and does
not look like a commercial product.

They want to make something newer and better and for this purpose need
to read data collected during nearly 20 years of usage. They would
have taken my reading routine and program around it, but they do not
have initial Fortran 77 environment: compiler, linker, libraries
although I think I have left it. That is why they wrote to me asking
if I kept it and I didn't. I have changed several PCs during these
years and if I have returned to this software, I'd have re-written it
in something more up-to-date, Visual Fortran would be the most natural
choice, would you agree?

galkas

On 20 Nov, 14:11, dpb <n...@xxxxxxx> wrote:
galkaswrote:
On 19 Nov, 15:53, dpb <n...@xxxxxxx> wrote:
galkaswrote:
Hello
There is a thread with such title in this group. I have read it, but
I think myproblemis slightly different.
I have written a software in 1992, which is still in use. Users'd like
to move to another, up-to-date platform. There is a huge amount of
data collected in these years, which were recorded by my software. To
move ahead, users need to read this data not only from my software.
Meanwhile, I completely have forgotten Fortran, worked for several
years making MS Access databases, now work as a manager and deal with
software as a user only.
I see a Fortran command:
WRITE(KN3,26)(YS(J),J=1,NTIME)
26 Format(10F8.1)
YS is an array of NTIME numbers, not integer.
What will be structure of data written by this command on binary
level?
How to read it from up-to-date Fortran?
Is it possible to read it from another software, for example Visual
Basic?
In addition to Gary Scott's response, to read the data from Fortran
simply use the same FORMAT statement and use READ instead of WRITE.
Since the width specified doesn't allow for a space between output
values if the values are sufficiently large, it is possible for them to
"run together" as his second example shows. (Although one would presume
that if that were the case that the data were that large numerically the
format would have been modified in the original code.)

In VB, there is no equivalent to Fortran FORMAT input processing so to
read this data reliably would require using Line Input# and then
converting each 10-character substring to its numeric value w/ either
Val() or CSng().

--- Hide quoted text -

- Show quoted text -

Hello
Thank you for your help. I thought myself that it should be ascii
code.
There was a suggestion that if to insert a divider between numbers,
the array will be possible to read in MS Excel. What software would I
use to insert dividers? Should Notepad read ascii code?

This is getting far afield from a Fortran question, but...

One would assume there's somethingreadingthese output files now
(otherwise, what point in making them?) so my first suggestion would be
to take that routine and modify it to also reformat the files.

It would certainly be possible to use Notepad or most any other editor
to make the modifications but would certainly not be my choice--as
noted, I'd write a tool to do it.

Of course, if there aren't too many, one could use the data import
function to select the fixed column option and read the files into Excel
directly. That could probably be automated in VBA or certainly a macro
could be written to read them as they stand...

--- Hide quoted text -

- Show quoted text -

.



Relevant Pages

  • Re: calling a function once works, calling it twice fails
    ... I have linked a C++-program with a fortran routine, ... end subroutine READ_DIMENSIONS ... Does your Fortran compiler have an option to check array subscripts? ...
    (comp.lang.fortran)
  • Re: 2d Gaussian Quadrature
    ... > complex-valued function of two real variables. ... > Fritsch, Kahaner, and Lyness, Double Integration Using One Dimensional ... > of an adaptive routine over a single application of a gaussian ... > More recently I converted this routine to Fortran 90 and also created ...
    (comp.lang.fortran)
  • Re: Reported any bugs in C-LAPACK routine DSPEVX?
    ... >>and call the latest Fortran LAPACK routines directly. ... For the dstevx routine I do it like this. ... the declaration can be done also in a header.h file which is ... There exists other ways of including lapack routines into C. ...
    (sci.math.num-analysis)
  • Re: fortran pointer structure
    ... From your discussion, it's quite clear that you are using, in your Fortran ... routine, the assumed-shape (hope I got that one correct - they all start ... I do know that the VAX FORTRAN compiler did this: ...
    (comp.lang.fortran)