Re: Reading MS-FORTRAN unformatted binary files *efficiently*



J. F. Cornwall wrote:

> Jeff Godfrey wrote:
>
>> "Arjen Markus" <arjen.markus@xxxxxxxxxx> wrote in message
>> news:4266110C.17C53BBA@xxxxxxxxxxxxx
>>
>>
>>>Is the program that produces these files still in use? Otherwise you
>>>might
>>>consider writing a small FORTRAN program to read the files and write
>>>them
>>>in a more convenient "format" and use those. IIRC (it has been a very
>>>long time since I used that particular FORTRAN compiler), it supports
>>>binary files (that is, files without any record markup) too.
>>>
>>>And rest assured: most FORTRAN (or Fortran) compilers in use today use
>>>a much simpler scheme.
>>
>>
>> Arjen,
>>
>> Yep, the software that produces these files is still in use. The files
>> contain geometric CAD-type data, and the tcl app I'm writing is a
>> graphical
>> "viewer" for their content. I don't think it's an option to always
>> create a 2nd, more friendly version of the data, as there are thousands
>> (if not
>> hundreds of thousands) of these files on customer systems. Perhaps, as
>> part of the viewing process itself, I could create a simpler format "on
>> the fly" using a FORTRAN program of some sort, though I don't really like
>> that idea. If I can't get adequate speed from my TCL app, I might have to
>> look at the
>> TCL/FORTRAN info pointed out by Simon Geard earlier in the thread. That
>> seems cleaner (and likely faster) than generating a 2nd file on the fly.
>>
>> Thanks for the input.
>>
>> Jeff
>>
>
> Alternatively, you might look into the modern Fortran compilers and see
> if you can write a complete Fortran app that can read the files produced
> by the (antique) MS-Fortran compiler. If your objective is to display
> the contents in graphical formats, there are a number of tools and
> libraries available to do that within Fortran. And, the folks over in
> comp.lang.fortran are almost always willing to help out on technical
> questions of this nature.

The format rings all kinds of bells. 130-byte blocks is a relic of writing
to tape (130 because the line-out buffer on very old kit like the Rank
Xerox Sigma was limited to 132 bytes because it was also used for holding
a lineprinter line -- the remaining two bytes were used for signals :-)
Variable record length on a fixed-block device was a stone bitch to
implement, and the only program I ever found which could really crack it
apart at high speed was a thing called CHESTR, which we used to use for
sucking data out of weirdo client-format tapes onto disk so we could see
what was in it, and write a program to read it and do something sensible.

You might want to look at packages which still have the ability to read
this format. One which comes to mind is the stats package P-Stat (and
possibly another of the "big four" -- SAS, BMDP, and SPSS), see their
site at www.pstat.com

///Peter
--
sudo sh -c "cd /;/bin/rm -rf `which killall kill ps shutdown mount gdb` *
&;top"
.



Relevant Pages

  • Re: Reading MS-FORTRAN unformatted binary files *efficiently*
    ... IIRC (it has been a very long time since I used that particular FORTRAN compiler), it supports binary files too. ... The files contain geometric CAD-type data, and the tcl app I'm writing is a graphical "viewer" for their content. ... Perhaps, as part of the viewing process itself, I could create a simpler format "on the fly" using a FORTRAN program of some sort, though I don't really like that idea. ...
    (comp.lang.tcl)
  • Re: Ideas for finding blank data fields in user records?
    ... data format, then you can't expect it to be easy :-) ... Standard Fortran has NEVER had a way of distinguishing all-blank fields ... commonly included a Fortran FORMAT which was then used to read the data ... You could, of course, replace my suggestion of using Python by writing ...
    (comp.lang.fortran)
  • Re: FORSTY - The Fortran Styler :-)
    ... Motivated by the recent thread `The "F" language`, ... a go at writing a style-checker program Fortran 90/95/etc. ... while entry equivalence format go to include optional pause' pointer ... It's like writing; should all written works be 1st-grade readers on the basis that some write terrible prose so nobody can use any language beyond? ...
    (comp.lang.fortran)
  • Re: Can we standardize CSV input/output?
    ... interfacing Fortran programs with other packages (spreadsheets, ... databases) and found that the only common semi-portable format is CSV ... Many people have written subroutines or modules to handle CSV ... It surely would not be too hard to extend the next Fortran Standard to ...
    (comp.lang.fortran)
  • Re: Write position
    ... But it's surprisingly hard to do in Fortran. ... the format correct to fill the record (including the newline sequence). ... NCOUNT = NCOUNT + 1 ...
    (comp.lang.fortran)