home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d7xx
/
d747
/
aush.lha
/
AUSH
/
ExtraCmds.lha
/
englishdocs
/
cut.doc
< prev
next >
Wrap
Text File
|
1992-09-04
|
2KB
|
71 lines
NAME
cut - cut out selected fields of each line of a file
SYNOPSIS
cut -clist [file ...]
cut -flist [-dchar] [-s] [file ...]
DESCRIPTION
Use cut to cut out columns from a table or fields from each
line of a file; in data base parlance, it implements the
projection of a relation. The fields as specified by list
can be fixed length, i.e., character positions as on a
punched card (-c option) or the length can vary from line to
line and be marked with a field delimiter character like tab
(-f option). cut can be used as a filter : if no files are
given, the standard input is used. If you specify - as a file,
standard input will be used.
The meanings of the options are:
list A comma-separated list of integer
field numbers (in increasing order),
with optional - to indicate ranges
(e.g.: 1,4,7 or 1-3,8) You can specify
-y for 1-y or x- for x till end, or
even - for all.
-clist The list following -c (no space)
specifies character positions
(e.g., -c1-72 would pass the first
72 characters of each line).
-flist The list following -f is a list of
fields assumed to be separated in
the file by a delimiter character
(see -d ); e.g., -f1,7 copies the
first and seventh field only.
Lines with no field delimiters will
be passed through intact (useful
for table subheadings), unless -s
is specified.
-dchar The character following -d is the
field delimiter (-f option only).
Default is tab. Space or other
characters with special meaning to
the shell must be quoted.
-s Suppresses lines with no delimiter
characters in case of -f option.
Unless specified, lines with no
delimiters will be passed through
untouched.
Either the -c or -f option must be specified as the first
command line option.
RETURN CODES
0 if all went well
1 in case of bad argument (fatal)
2 if at least one file couldn't be opened (non fatal)
CHANGES FROM UNIX
Doesn't complain when a list is x-y and y is greater than x,
but simply exchange values.
AUTHOR
Denis GOUNELLE
Last modified 04-Sep-92