c
cut(1) | cut(1) |
NAME
cut - cut out (extract) selected ®elds of each line of a ®le
SYNOPSIS
cut
cut
cut
DESCRIPTION
cut cuts out (extracts) columns from a table or ®elds from each line in a ®le; in data base parlance, it implements the projection of a relation. Fields as speci®ed by list can be ®xed length (de®ned in terms of character or byte position in a line when using the
When processing
Options
Options are interpreted as follows: |
|
| |
list | A | character | |
| option) numbers, in increasing order, with optional | - to indicate ranges. For exam- | |
| ple: |
|
|
| 1,4,7 Positions 1, 4, and 7. |
| |
|
| ||
| Positions 1 through 5 and 10. |
| |
| 3- | Position 3 through last position. |
|
Cut based on a list of bytes. Each selected byte is output unless the | |||
| speci®ed. |
|
|
Cut based on character positions speci®ed by list | |||
| acters of each line). |
| |
Where list is a list of ®elds assumed to be separated in the ®le by a delimiter charac- | |||
| ter (see | ||
| no ®eld delimiters will be passed through intact (useful for table subheadings), unless | ||
|
|
| |
The character following | |||
| Space or other characters with special meaning to the shell must be quoted. Adjacent | ||
| ®eld delimiters delimit null ®elds. char may be an international code set character. | ||
Do not split characters. If the high end of a range within a list is not the last byte of a | |||
| character, that character is not included in the output. However, if the low end of a | ||
| range within a list is not the ®rst byte of a character, the entire character is included | ||
| in the output." |
|
|
Suppresses lines with no delimiter characters when using | |||
| speci®ed, lines with no delimiters appear in the output without alteration. |
Hints
Use grep to extract text from a ®le based on text pattern recognition (using regular expressions). Use paste to merge ®les
EXTERNAL INFLUENCES
Environment Variables
LC_CTYPE determines the interpretation of text as single and/or
If LC_CTYPE is not speci®ed in the environment or is set to the empty string, the value of LANG is used as a default for each unspeci®ed or empty variable. If LANG is not speci®ed or is set to the empty string, a
Section 1−162 | − 1 − |