| pcut - Cut given fields of text input separated by the given Perl regex |
pcut - Cut given fields of text input separated by the given Perl regex
pcut [OPTIONS] [FILE [FILE [...]]]
Standard cut(1) breaks up input lines by a given single char.
pcut(1) does this by the given perl(1)-compatible regular expression.
cut(1) outputs fields always in ascending order, without duplication.
pcut(1) outputs fields in the requested order, even multiple times if asked so by the -f option.
Counted from 1.
See cut(1) for syntax.
Default is whitespace (\s+).
See the same option in cut(1).
Define the output field delimiter. Default is not to use a constant output delimiter, but to preserve the separator substrings as they matched to the pattern of -d option (see --prefer-preceding-delimiter and --prefer-succeeding-delimiter options).
Contrary to cut(1), pcut(1) does not always use a constant delimiter char,
but a regexp pattern which may match to different substrings between fields in the input lines.
Each output field (except the last one) is followed by that substring which was matched to the delimiter pattern just right after that field in the input.
With --prefer-preceding-delimiter, each output field (except the first one) is similarly preceded by that substring which was matched to the delimiter pattern just before that field in the input.
Write STRING before field 1 if it is not the first field on the output (in --prefer-preceding-delimiter mode).
Write STRING after the last field if it is written not as the last field on the output.
Terminate output records (lines) by NUL char instead of LineFeed.
cut(1),
hck,
tuc,
rextr(1),
arr(1) arr,
choose
| pcut - Cut given fields of text input separated by the given Perl regex |