NEWFORM(1)

NAME
newform - change the format of a text file

SYNOPSIS

newform [-s] [-i[tabspec]] [-o[tabspec]] [-f] [-p[n]] [-a[n]] [-c[char]] [-e[n]] [-b[n]] [-l[n]] [file ...]

DESCRIPTION
Newform reads its input files, or standard input if no file argument is present, and writes them to standard output after changing the format of each line as specified by the options.

The order of options is significant; newform performs the conversions on each line in the order indicated by the options (except for the -s option). The file arguments may appear between options, but all options apply to each file. Each option must be given as an argument of its own.

The following options are valid:

-s  Shear characters of the line up to the first tabulator character, perform all other processing on the remaining characters, and append the sheared characters to the end of the line thereafter. If more than eight characters precede the first tabulator, the eighth character is replaced by a `*' and further preceding characters are discarded.

-i[tabspec]
    Replace tabulators found in the line by spaces according to tabspec. The format of tabspec is the same as for the tabs(1) utility; thus `-i-c2' selects tabulators according to the COBOL compact format. If tabspec is omitted, it defaults to -8 (i.e. set a tab stop at every eight positions). Backspaces found in the line decrease the column count by one.

-o[tabspec]
    Replace sequences of one or more spaces by tabulators according to tabspec if possible; otherwise as described for -i.

-f  Print the last applied output tabulator specification (as specified by -o) in fspec(5) format before producing output for the first line.

-p[n]
    If the current line is shorter (in characters, not column positions) than the width as described for -l, prepend the appropriate number of spaces (or of the character previously specified with -c) to the characters currently in the line. If n is specified, prepend n characters to all short lines.

-a[n]
    Append characters to short lines, otherwise as described for -p.

-c[char]
    Set the padding character used with -p and -a to char. The default is the space character.

-b[n]
    If the current line exceeds the width (in characters) as described for -l, discard the appropriate number of characters to make the line fit, or n characters if specified.

-e[n]
    Truncate long lines at the end, otherwise as described for -b.

-l[n]
    Set the desired line width to n. If n is omitted, the line width is set to 72; if no -l option was specified, the line width defaults to 80.

ENVIRONMENT VARIABLES

LANG, LC_ALL
    See locale(7).

LC_CTYPE
    Determines the mapping of bytes to characters and the width of characters.

SEE ALSO
tabs(1), fspec(5)