Commit | Line | Data |
---|---|---|
c72499ab | 1 | .\" @(#)join.1 5.1 (Berkeley) %G% |
9aaec80d | 2 | .\" |
c72499ab | 3 | .TH JOIN 1 "18 January 1983" |
9aaec80d KM |
4 | .AT 3 |
5 | .SH NAME | |
6 | join \- relational database operator | |
7 | .SH SYNOPSIS | |
8 | .B join | |
9 | [ | |
10 | options | |
11 | ] | |
12 | file1 file2 | |
13 | .SH DESCRIPTION | |
14 | .I Join | |
15 | forms, on the standard output, | |
16 | a join | |
17 | of the two relations specified by the lines of | |
18 | .I file1 | |
19 | and | |
20 | .IR file2 . | |
21 | If | |
22 | .I file1 | |
23 | is `\-', the standard input is used. | |
24 | .PP | |
25 | .I File1 | |
26 | and | |
27 | .I file2 | |
28 | must be sorted in increasing ASCII collating | |
29 | sequence on the fields | |
30 | on which they are to be joined, | |
31 | normally the first in each line. | |
32 | .PP | |
33 | There is one line in the output | |
34 | for each pair of lines in | |
35 | .I file1 | |
36 | and | |
37 | .I file2 | |
38 | that have identical join fields. | |
39 | The output line normally consists of the common field, | |
40 | then the rest of the line from | |
41 | .IR file1 , | |
42 | then the rest of the line from | |
43 | .IR file2 . | |
44 | .PP | |
45 | Fields are normally separated by blank, tab or newline. | |
46 | In this case, multiple separators count as one, and | |
47 | leading separators are discarded. | |
48 | .PP | |
49 | These options are recognized: | |
50 | .TP | |
51 | .BI \-a n | |
52 | In addition to the normal output, | |
53 | produce a line for each unpairable line in file | |
54 | .IR n , | |
55 | where | |
56 | .I n | |
57 | is 1 or 2. | |
58 | .TP | |
59 | .BI \-e \ s | |
60 | Replace empty output fields by string | |
61 | .IR s . | |
62 | .TP | |
63 | .BI \-j n\ m | |
64 | Join on the | |
65 | .IR m th | |
66 | field of file | |
67 | .IR n . | |
68 | If | |
69 | .I n | |
70 | is missing, use the | |
71 | .IR m th | |
72 | field in each file. | |
73 | .TP | |
74 | .BI \-o \ list | |
c72499ab | 75 | Each output line comprises the fields specified in |
9aaec80d KM |
76 | .IR list , |
77 | each element of which has the form | |
78 | .IR n . m , | |
79 | where | |
80 | .I n | |
81 | is a file number and | |
82 | .I m | |
83 | is a field number. | |
84 | .PP | |
85 | .TP | |
86 | .BI \-t c | |
87 | Use character | |
88 | .I c | |
89 | as a separator (tab character). | |
90 | Every appearance of | |
91 | .I c | |
92 | in a line is significant. | |
93 | .SH "SEE ALSO" | |
94 | sort(1), comm(1), awk(1) | |
95 | .SH BUGS | |
96 | With default field separation, | |
97 | the collating sequence is that of | |
98 | .IR sort\ \-b ; | |
99 | with | |
100 | .BR \-t , | |
101 | the sequence is that of a plain sort. | |
102 | .PP | |
103 | The conventions of | |
104 | .I join, sort, comm, uniq, look | |
105 | and | |
106 | .IR awk (1) | |
107 | are wildly incongruous. |