BSD 4_3_Tahoe development
[unix-history] / usr / man / cat1 / join.0
JOIN(1) UNIX Programmer's Manual JOIN(1)
N\bNA\bAM\bME\bE
join - relational database operator
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
j\bjo\boi\bin\bn [ options ] file1 file2
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
_\bJ_\bo_\bi_\bn forms, on the standard output, a join of the two rela-
tions specified by the lines of _\bf_\bi_\bl_\be_\b1 and _\bf_\bi_\bl_\be_\b2. If _\bf_\bi_\bl_\be_\b1
is `-', the standard input is used.
_\bF_\bi_\bl_\be_\b1 and _\bf_\bi_\bl_\be_\b2 must be sorted in increasing ASCII collating
sequence on the fields on which they are to be joined, nor-
mally the first in each line.
There is one line in the output for each pair of lines in
_\bf_\bi_\bl_\be_\b1 and _\bf_\bi_\bl_\be_\b2 that have identical join fields. The output
line normally consists of the common field, then the rest of
the line from _\bf_\bi_\bl_\be_\b1, then the rest of the line from _\bf_\bi_\bl_\be_\b2.
Fields are normally separated by blank, tab or newline. In
this case, multiple separators count as one, and leading
separators are discarded.
These options are recognized:
-\b-a\ba_\bn In addition to the normal output, produce a line for
each unpairable line in file _\bn, where _\bn is 1 or 2.
-\b-e\be _\bs Replace empty output fields by string _\bs.
-\b-j\bj_\bn _\bm
Join on the _\bmth field of file _\bn. If _\bn is missing, use
the _\bmth field in each file.
-\b-o\bo _\bl_\bi_\bs_\bt
Each output line comprises the fields specified in
_\bl_\bi_\bs_\bt, each element of which has the form _\bn._\bm, where _\bn
is a file number and _\bm is a field number.
-\b-t\bt_\bc Use character _\bc as a separator (tab character). Every
appearance of _\bc in a line is significant.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
sort(1), comm(1), awk(1)
B\bBU\bUG\bGS\bS
With default field separation, the collating sequence is
that of _\bs_\bo_\br_\bt -_\bb; with -\b-t\bt, the sequence is that of a plain
sort.
Printed 7/9/88 April 29, 1985 1
JOIN(1) UNIX Programmer's Manual JOIN(1)
The conventions of _\bj_\bo_\bi_\bn, _\bs_\bo_\br_\bt, _\bc_\bo_\bm_\bm, _\bu_\bn_\bi_\bq, _\bl_\bo_\bo_\bk and _\ba_\bw_\bk(1)
are wildly incongruous.
Printed 7/9/88 April 29, 1985 2