fmlcut(1F) (Form and Menu Language Interpreter) fmlcut(1F)
NAME
fmlcut - cut out selected fields of each line of a file
SYNOPSIS
fmlcut -clist [file ...]
fmlcut -flist [-dchar] [-s] [file ...]
DESCRIPTION
The fmlcut function cuts out columns from a table or fields from each
line in file. In database parlance, fmlcut implements the projection
of a relation. fmlcut can be used as a filter. If file is not speci-
fied or is - then the standard input is read. list specifies the
fields to be selected. Fields can be fixed length (character posi-
tions) or variable length (separated by a field delimiter character),
depending on whether -c or -f is specified.
Either the -c or the -f option must be specified.
These options are available with fmlcut:
list A comma-separated list of integer field numbers in increasing
order. Use of the - to indicate ranges is optional. For exam-
ple: 1,4,7 or 1-3,8 or -5,10 (short for 1-5,10) or 3- (short
for third through last field).
-clist If -c is specified, list specifies character positions (for
example, -c1-72 passes the first 72 characters of each line).
No space intervenes between -c and list.
-flist If -f is specified, list is a list of fields assumed to be
separated in the file by the default delimiter character, TAB,
or by char if the -d option is specified. For example, -f1,7
copies the first and seventh field only. Lines with no delim-
iter characters are passed through intact (useful for table
subheadings), unless -s is specified. No space intervenes
between -f and list. The following options can be used if you
have specified -f.
-dchar If -d is specified, char is the field delimiter. Space
or other characters with special meaning to FMLI must
be quoted. No space intervenes between -d and char.
The default field delimiter is TAB.
-s Suppresses lines with no delimiter characters. If -s
is not specified, lines with no delimiters are passed
through untouched.
Page 1 Reliant UNIX 5.44 Printed 11/98
fmlcut(1F) (Form and Menu Language Interpreter) fmlcut(1F)
EXAMPLES
fmlcut -d: -f1,5 /etc/passwd
Gets login IDs and names
`who am i | fmlcut -f1 -d" "`
Gets the current login name
DIAGNOSTICS
fmlcut returns the following exit values:
0 The selected field is successfully cut out
2 Syntax errors
The following error messages may be displayed on the FMLI message
line:
ERROR: line too long
A line has more than 1023 characters or fields or there is no
new-line character.
ERROR: bad list for c/f option
Missing -c or -f option or incorrectly specified list. No error
occurs if a line has fewer fields than the list calls for.
ERROR: no fields
The list is empty.
ERROR: no delimiter
Missing char on -d option.
NOTES
fmlcut cannot correctly process lines longer than 1023 characters or
lines with no newline character.
SEE ALSO
fmlgrep(1F).
Page 2 Reliant UNIX 5.44 Printed 11/98