NEWFORM(1) DOMAIN/IX Reference Manual (SYS5) NEWFORM(1)
NAME
newform - change the format of a text file
USAGE
newform [-s] [ -itabspec ] [ -otabspec ] [ -bn ] [ -en ] [
-pn ] [ -an ] [ -f ]
[ -cchar ] [ -ln ] [ files ]
DESCRIPTION
Newform reads lines from the named files (or the standard
input if no input file is named) and reproduces the lines on
the standard output. It reformats lines according to com-
mand line options in effect.
Except for -s, options may appear in any order, may be
repeated, and may be intermingled with the optional files.
Newform processes options in the order specified. This
means that option sequences like -e 15 -l 60 yield results
different from -l 60 -e 15. Options are applied to all
files on the command line.
OPTIONS
-itabspec Input tab specification: expand tabs to spaces,
according to given tab specifications. Tabspec
recognizes all tab specification forms described
in tabs (1). In addition, tabspec may be a dash
(-), signifying that the tab specification is to
be found in the first line read from the standard
input. If no tabspec is given, tabspec defaults
to -8 . A tabspec of -0 expects no tabs; if any
are found, they are treated as -1.
-otabspec Output tab specification: replace spaces by tabs,
according to given tab specifications. The tab
specifications are the same as for -itabspec. If
no tabspec is given, tabspec defaults to -8. A
tabspec of -0 means that no spaces are converted
to tabs on output.
-ln Set the effective line length to n characters. If
n is not entered, -l defaults to 72. The default
line length without the -l option is 80 charac-
ters. Note that tabs and backspaces are con-
sidered to be one character (use -i to expand tabs
to spaces).
-bn Truncate n characters from the beginning of the
line when the line length is greater than the
effective line length (see -ln). If no n is
specified, truncate the number of characters
necessary to obtain the effective line length.
Printed 6/10/85 NEWFORM-1
NEWFORM(1) DOMAIN/IX Reference Manual (SYS5) NEWFORM(1)
-en Same as -bn except that characters are truncated
from the end of the line.
-cchar Change the prefix/append character to char. By
default, this character is a space.
-pn Prefix n characters (see -ck) to the beginning of
a line when the line length is less than the
effective line length. The default is to prefix
the number of characters necessary to obtain the
effective line length.
-an Same as -pn except characters are appended to the
end of a line.
-f Write the tab specification format line on the
standard output before any other lines are output.
The tab specification format line that is printed
corresponds to the format specified in the last -o
option. If no -o option is specified, the line
that is printed contains the default specification
of -8.
-s Shear off leading characters on each line up to
the first tab and place up to eight of the sheared
characters at the end of the line. If more than
eight characters (not counting the first tab) are
sheared, replace the eighth character by an aster-
isk (*) and discard any characters to the right of
it. The first tab is always discarded.
An error message and program exit occurs if this
option is used on a file without a tab on each
line. The characters sheared off are saved inter-
nally until all other options specified are
applied to that line. The characters are then
added at the end of the processed line.
EXAMPLES
To delete the sequence numbers from a COBOL program, use the
newform command as follows:
newform -l1 -b7 filename
(The -l1 must be used to set the effective line length
shorter than any existing line in the file so that the -b
option is activated).
To convert a file with leading digits, one or more tabs, and
text on each line, to a file beginning with the text, all
tabs after the first expanded to spaces, padded with spaces
out to column 72 (or truncated to column 72), and the
NEWFORM-2 Printed 6/10/85
NEWFORM(1) DOMAIN/IX Reference Manual (SYS5) NEWFORM(1)
leading digits placed starting at column 73, specify this::
newform -s -i -l -a -e filename
CAUTIONS
Newform normally only keeps track of physical characters.
However, if you use the -i and -o options, newform keeps
track of backspaces so that tabs can be lined up in the
appropriate logical columns.
Newform does not prompt you if a tabspec is to be read from
the standard input.
If the -f option is used, and the last -o option specified
was -o- -, and was preceded by either a -o- - or a -i- -,
the tab specification format line will be incorrect.
DIAGNOSTICS
All diagnostics are fatal.
``usage: ...'' bad option used
``not -s format'' a line is missing a tab
``can't open file'' self-explanatory
``internal line too long''
a line exceeds 512 characters after
being expanded in the internal work
buffer
``tabspec in error''
a tab specification is incorrectly for-
matted, or specified tab stops are not
ascending
``tabspec indirection illegal''
a tabspec read from a file (or standard
input) may not contain a tabspec
referencing another file (or standard
input)
EXIT CODES
0 - normal execution
1 - for any error
RELATED INFORMATION
csplit (1), tabs (1).
Printed 6/10/85 NEWFORM-3