[comp.os.vms] utility to truncate trailing blanks wanted

peter@julian.UUCP (07/21/87)

Is there a utility for VMS that truncates trailing blanks from a fixed line
length file?  On our Tops-10 system we did it with PIP.  I was hoping for a
switch to type or copy or convert, but I can't see anything.

Please e-mail responses (pick an address).

-- 
Peter Marshall, Data Comm. Manager
CCS, U. of Western Ontario, London, Canada N6A 5B7
(519)661-2151x6032 
pm@uwovax.BITNET; pm@uwovax.uwo.cdn; peter@julian.uucp; ...!watmath!julian!peter

peter@julian.UUCP (07/23/87)

Thanks to all who submitted solutions.  The problem is licked (and licked
and...).  I was not able to reply to all due to some very strange addresses
so this medium will have to suffice.
-- 
Peter Marshall, Data Comm. Manager
CCS, U. of Western Ontario, London, Canada N6A 5B7
(519)661-2151x6032 
pm@uwovax.BITNET; pm@uwovax.uwo.cdn; peter@julian.uucp; ...!watmath!julian!peter

F1142S30%unika2@germany.CSNET (Juergen Renz) (07/25/87)

Peter Marshall asks:
> Is there a utility for VMS that truncates trailing blanks from a fixed line
> length file?  On our Tops-10 system we did it with PIP.  I was hoping for a
> switch to type or copy or convert, but I can't see anything.

I have the same problem from time to time. My solution then is a litte
EDT command file:

$ create untrail.edt
! don't skip one blank in the first line
set search end
! remove all spaces at the end of lines
change;32000(s/ ^M/^M/-bl)ex
exit

Note:   ^M is the ascii representation for 13 (decimal).
        You can insert this control character in an EDT session with:
        <PF1>  13  <PF1>  <3>

        13           are the numeric keys 1 and 3
        <3>          is on the (righthanded) application keypad
        <PF1>  <3>   calls the function SPECINS

Call the EDT with the following command:

$ edit/edt/command=untrail  infile /output=outfile

Attention:   This command file will not work correct if

             - there are lines longer than 255 characters in the file
               (edt cannot read such long records)

             - there are <CR> characters inbetween a line,
               (these are converted to a newline)

P.S.:  There is a better way doing it with a TPU procedure, but I havn't
       much experience in TPU language. Maybe in future I will write one,
       or is there anybody else, who has such a thing ?

Juergen Renz                                        Universitaet Karlsruhe
Falkengarten 7                                      Institut fuer Informatik IV
D-7530 Pforzheim
West-Germany