cut

NAME

cut - Windows command-line utility to cut out the selected fields of each line of a file

SYNOPSIS

cut -b list [-n] [-] | [file...]
cut -c list [-] | [file...]
cut -f list [-d delim] [-s] [-] | [file...]

DESCRIPTION

The cut(1w) utility cuts out bytes (-b option), characters (-c option), or character-delimited fields (-f option) from each line in one or more files, concatenates them, and writes them to the standard output.

The option-argument list must be a comma-separated list of positive numbers and ranges. Ranges can be expressed in three forms. The first is two positive numbers separated by a hyphen (-) (low-high), which represents all fields from the first number to the second number. The second is a positive number preceded by a hyphen (-high), which represents all fields from field number 1 to that number. The third is a positive number followed by a hyphen (low-), which represents that number to the last field. The elements in the list can be repeated, overlapped, and specified in any order.

OPTIONS

The cut utility supports the following options:

-b
Cuts based on a list of bytes. Each selected byte is the output unless the -n option is also specified. It is not an error to select bytes absent in the input line.
-c
Cuts based on a list of characters. Each selected character is the output. It is not an error to select characters absent in the input line.
-d
Sets the field delimiter to the character delim. The default is the TAB character.
-f
Cuts based on a list of fields, assumed to be separated in the file by a delimiter character (see the -d option). Each selected field is the output. Output fields are separated by a single occurrence of the field-delimiter character. Lines with no field delimiter are passed through intact unless the -s option is specified. It is not an error to select fields absent in the input line.
-n
Does not split characters. When the -n option is specified with the -b option, each element in list of the form low-high (hyphen-separated numbers) is modified as follows:
-s
When used with the -f option, -s suppresses lines with no delimiter characters. Unless specified, lines with no delimiters are passed through untouched.

DIAGNOSTICS

Possible exit-status values are:

0
Successful completion
1
Failure