|
|
1.1 root 1:
2:
3: join Command join
4:
5:
6:
7:
8: Join two data bases
9:
10: jjooiinn [-aa [_n] ] [-ee _s_t_r_i_n_g ] [-jj[_n] _k_e_y_f] [-oo _n._m ...] [-tt_c] _f_i_l_e_1 _f_i_l_e_2
11:
12: join processes the text files file1 and file2, each of which con-
13: tains a relational data base. If either file name is `-', the
14: standard input is used for that file.
15:
16: For the purposes of join, a data base file contains a set of
17: records, one per input line. Each record contains a number of
18: fields. One field is differentiated as key field for each file.
19: Each file must be sorted by key field, for example with sort.
20:
21: By default, the key field is the first field in each record. The
22: -j option changes the key field number to keyf for the desired
23: file. In this and other options below, the optional file number
24: n must be 1 to indicate file1 or 2 to indicate file2. If no n is
25: given, both file1 and file2 are assumed.
26:
27: Normally, fields are separated by any amount of white space
28: (blanks or tabs). Leading blanks or tabs are not considered part
29: of the fields. With the -t option, the separator character is c.
30: With this option zero-length fields are possible; every occur-
31: rence of the separator ends the previous field and starts a new
32: one.
33:
34: Output consists only of records for which the key field occurs in
35: both files. As a consequence of the sorted order of the input,
36: the output is also sorted by the key field. Each output record
37: has first the key field, then each field from the file1 record
38: but the key field, and then each field from the file2 record but
39: the key field. Fields are separated in the output with the
40: specified field character, or with a space character if no -t
41: option was given. Output records are always terminated with a
42: newline. Under the -e option, string is printed for each empty
43: field.
44:
45: The -a option enables printing of records found in only file n.
46: If n is missing, unpaired records are printed from both input
47: files. To output only certain fields, the -o option precedes a
48: list of desired fields to print. Each element is of the form n.m
49: where n is the file number and m is the field number.
50:
51: For example,
52:
53:
54: join -t: -j1 3 -o 1.3 2.4 1.4 1.1 2.2 filea fileb
55:
56:
57: joins filea and fileb which have fields separated by the colon
58: (`:') character. The join field number is 3 for filea and 1 (by
59: default) for fileb. The selected five fields are produced in the
60: output.
61:
62:
63:
64: COHERENT Lexicon Page 1
65:
66:
67:
68:
69: join Command join
70:
71:
72:
73: ***** See Also *****
74:
75: awk, comm, commands, sort, uniq
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130: COHERENT Lexicon Page 2
131:
132:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.