1.1;exfld (extract_fields), revision 1.1, 81/07/01
EXFLD (EXTRACT_FIELDS) -- Manipulate fields of data.
usage: EXFLD {field-list | -T [c]} output_format [pathname ...]
FORMAT
EXFLD {field_spec} output_format [pathname ...]
EXFLD manipulates data kept in formatted fields. It copies data from
specified fields of the input files to specified places in standard output.
ARGUMENTS
field_spec
(required) Specify either one of the following two arguments:
field_list
Integer list identifying fields in the input file to be
copied. Up to 9 input fields are allowed. You can specify
a field by the columns in which it occurs or by its
starting column and length. For example, 5-10 denotes a
field that extends from column 5 through column 10, and 3+2
denotes a field that starts in column 3 and spans 2
columns. When specifying more than one field, separate the
specifications with commas, for example:
5-10,16,72+8
Fields can overlap, and need not be in ascending numerical
order. Thus
1-25,10,3
is a valid field specification.
-T [c]
Free-format separator specification. If input fields do not
fall in certain columns, but rather are separated by some
character (such as a blank or a comma), describe the fields
by using '-T c', replacing 'c' with the appropriate
separator. A tab character is the default for 'c'.
output_format
(required) Specify literal string representing output format. Fields
from input are referred to as $1, $2, $3, and so forth,
denoting the order in which the fields are specified. Up
to 9 fields are allowed, plus the argument $0 which refers
to the whole line. Place the $n symbol in the output
format wherever the corresponding field should appear,
surrounded by any characters desired. For example, an
output format of:
"$2 somewords $1"
would produce an output line such as:
field2 somewords field1
pathname
(optional) Specify input file to be manipulated.
Default if omitted: read standard input
EXAMPLES
$ exfld 1-5,14-18 "$2 follows $1" Specify extraction.
ABCDE is not DEFGH Input text from standard input.
DEFGH follows ABCDE Result.
*** EOF *** Signal completion with CTRL/Z.
$