|
|
1.1 root 1: .TH CUT 1
2: .CT 1 files
3: .SH NAME
4: cut, paste \- rearrange columns of data
5: .SH SYNOPSIS
6: .B cut
7: .BI -c list
8: [
9: .I file ...
10: ]
11: .PP
12: .B cut
13: .BI -f list
14: [
15: .BI -d char
16: ]
17: [
18: .I file ...
19: ]
20: .PP
21: .B paste
22: [
23: .B -s
24: ]
25: [
26: .BI -d chars
27: ]
28: .I file ...
29: .SH DESCRIPTION
30: .I Cut
31: selects fields from each line of the
32: .I files
33: (standard input default).
34: In data base parlance, it
35: projects a relation.
36: The fields
37: can be fixed length,
38: as on a punched card (option
39: .BR -c ),
40: or be marked with a delimiter character (option
41: .BR -f ).
42: .PP
43: The meanings of the options follow.
44: Elements of a
45: .I list
46: are integers separated by commas, or by
47: .B -
48: to indicate a range, for example
49: .L 1,3-5,7.
50: .TF -d\ char\ \
51: .PD
52: .TP
53: .BI -c list
54: The
55: .I list
56: specifies character
57: positions.
58: .TP
59: .BI -f list
60: The
61: .I list
62: specifies field numbers.
63: .TP
64: .BI -d char
65: The character
66: is the delimiter for option
67: .BR -f .
68: Default is tab.
69: .TP
70: .B -s
71: Suppress lines with no delimiter characters.
72: Normally such lines pass through untouched under option
73: .BR -f .
74: .PP
75: .I Paste
76: concatenates corresponding lines of the input
77: .I files
78: and places the result on the standard output.
79: The file name
80: .L -
81: refers to the standard input.
82: Lines are glued together with
83: characters taken circularly from the set
84: .I chars.
85: The set may contain the special escape sequences
86: .B \en
87: (newline),
88: .B \et
89: (tab),
90: .B \e\e
91: (backslash), and
92: .B \e0
93: (empty string, not a null character).
94: The options are
95: .TP
96: .BI -d chars
97: The output separator characters.
98: Default is a tab.
99: .TP
100: .B -s
101: Paste together lines of one file,
102: treating every line as if it came from a distinct input.
103: .SH EXAMPLES
104: .TP
105: .L
106: cut -d: -f1,3 /etc/passwd
107: Print map from login names to userids, see
108: .IR passwd (5).
109: .TP
110: .L
111: NAME=`who am i | cut -f1 -d" "`
112: Set
113: .L NAME
114: to current login name (subtly different from
115: .IR getuid (1)).
116: .PP
117: .EX
118: ls | paste - - - -
119: ls | paste -s '-d\et\en' -
120: .EE
121: .ns
122: .IP
123: 4-column and 2-column file listing
124: .SH SEE ALSO
125: .IR gre (1),
126: .IR awk (1),
127: .IR sed (1),
128: .IR pr (1),
129: .IR column (1)
130: .SH BUGS
131: .I Cut
132: should handle disordered lists.
133: .br
134: In default of file names,
135: .I paste
136: should read the the standard input.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.