trim.icn: Program to trim lines in a file

December 26, 1998; Ralph E. Griswold
This file is in the public domain.
   This program copies lines from standard input to standard out-
put, truncating the lines at n characters and removing any trail-
ing blanks and tabs. The default value for n is 80.  For example,

        trim 70 <grade.txt >grade.fix

copies grade.txt to grade.fix, with lines longer than 70 charac-
ters truncated to 70 characters and the trailing blanks removed
from all lines.

   The -f option causes all lines to be n characters long by
adding blanks to short lines; otherwise, short lines are left as
is.

Source code | Program Library Page | Icon Home Page