[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

229.0. "How to Trim a Fortran-format Report" by GUIDO::RAVAN () Tue Apr 08 1986 15:12

    Hack request:
    
    We have an application (non-DEC) that generates reports in
    Fortran-format files. Unfortunately, it frames each page in asterisks
    and fills them with blanks, making each report two or three times
    the size it needs to be. What we would like to do is strip the trailing
    blanks (and the terminating asterisk) from each line, while either
    maintaining the Fortran carriage-control characters or changing
    them to regular format (<FF>'s, overprinting, etc.).
    
    I tried using DCL with the f$edit lexical, but the resulting file
    has lost track of the carriage-control characters.
    
    If anyone can provide a way to clean up these report files, I'd
    appreciate it!
    
    -beth ravan
T.RTitleUserPersonal
Name
DateLines
229.1VAX/SCAN?SHOGUN::BLUEJAYHave Wings - will travelTue Apr 08 1986 16:289
    Sounds like a job for VAX/SCAN, a block-structured language for
    manipulating text.
    
    Of course, using a text-manipulation language to manipulate text
    hardly qualifies as a hack.
    
    						- Bluejay Adametz, CFII
    
    [no, I don't have the Q-numbers. sorry]
229.2SCAN has lotsa examples, too.11740::BLESSLEYTue Apr 08 1986 17:307
    If your application is internal, the kit is available somewhere
    around the net. SCAN is pretty neat; use one of the many examples that
    come with the installation kit and hack it (that qualifies, doesn't
    it?) for your needs. There's a SCAN notesfile, too.
    
    -Scott
    
229.3PARVAX::PFAUHacker for hireTue Apr 08 1986 20:4216
    Re: .1
    
    If you don't have the Q-number, use the Q-register.  I once had
    a TECO program which read in a file with FORTRAN carriage control
    and expanded the carriage control characters.  TECO would probably
    work well to remove the borders, too.
    
    If you can convert the FTN carriage control to CR, get SPACE2TAB
    from the toolshed (or ENTAB).  These tools convert multiple spaces
    in a file to tabs; very good for reducing the size of report files
    while not modifying the content.

    Of course, nothing will be as efficient (most likely) than a program
    designed for the specific purpose.
    
    tom_p
229.4R2ME2::GILBERTJuggler of NoterdomTue Apr 08 1986 23:499
    Hello?  Did anybody hear the question?
    
    The VMS Convert utility once claimed that it could convert to/from
    VFC-format files (of which Fortran print-format files are one),
    putting the VFC information into the record, or vice-versa.
    
    I used this feature under V3 of VMS, but haven't used it under V4,
    even with some 'playing'.  Perhaps I had trouble getting the various
    qualifiers correct, or perhaps it was broken.
229.5Carriage Control TogglePICA::BLANCHETTEBobWed Apr 09 1986 05:398
	PICA::TOOLBOX:[BASIS.TOOLS]CARRIAGE.EXE will convert your
	file from Fortran Carriage Control to Carriage Return
	Carriage Control and back, if that's any help. Define
	it as a foreign command, and then CARRIAGE YOUR.FILE.

	It's a utility that's part of a software package (BASIS)
	which is licensed for corporate-wide distribution, internal
	use only.
229.6or FORTRAN to post-process the reportsFROST::PIPERbill piperWed Apr 09 1986 14:588
Or run it through yet another FORTRAN program.  On the output file OPEN,
use CARRIAGE_CONTROL='FORTRAN' (the default for formatted output).

Read a line, strip the lead and trailing asterisks, and pass it through
STR$TRIM (to get rid of the spaces before that trailing asterisk).
Throw in space-to-tab conversions if you wish.

-piper
229.7CONVERT does the trickVIRTUE::RAVANWed Apr 09 1986 15:2112
    Thanks, all, for the various suggestions. As it happens (my Fortran
    being rusty), I went for the CONVERT method. The documentation is
    a bit vague, but all that's needed is to create an FDL file with
    the CARRIAGE_CONTROL option set to "carriage_return" and the FORMAT
    set to "stream". This converts the Fortran characters to <CR>s and
    <FF>s. (Thanks, Peter!)
    
    From there, I used DCL and F$EDIT to trim the trailing blanks, and
    voila!

    -b