JOIN(1) DOMAIN/IX Reference Manual (SYS5) JOIN(1)
NAME
join - relational database operator
USAGE
join [ options ] file1 file2
DESCRIPTION
Join forms, on the standard output, a union between the two
relations specified by the lines of file1 and file2. If you
use a dash (-) in place of file1, the standard input is
used. File1 and file2 must be sorted in increasing ASCII
collating sequence in the fields where they are to be joined
(normally, the first in each line).
One line in the output for each pair of lines in file1 and
file2 will have identical join fields. The output line nor-
mally consists of the common field, then the remainder of
the line from file1, and finally, the remainder of the line
from file2.
The default input field separators are blank, tab, or new-
line. Multiple separators usually count as one field
separator, and leading separators are ignored. The default
output field separator is a blank.
OPTIONS
Some of the options below use the argument n. This argument
should be a 1 or 2 referring to either file1 or file2,
respectively.
-an In addition to the normal output, produce a line
for each line that cannot be paired in file n,
where n is 1 or 2.
-e s Replace empty output fields by string s.
-jn m Join on the mth field of file n. If n is missing,
use the mth field in each file. Fields are num-
bered starting with one.
-o list Let each output line comprise the fields specified
in list, each element of which has the form n.m,
where n is a file number and m is a field number.
Do not print the common field unless specifically
requested.
-tc Use character c as a separator (tab character) for
both input and output. Every appearance of c in a
line is significant.
EXAMPLE
To join the fourth field of both file1 and file2, use this
Printed 6/10/85 JOIN-1
JOIN(1) DOMAIN/IX Reference Manual (SYS5) JOIN(1)
command:
join -j1 4 -j2 4 file1 file2
CAUTIONS
With default field separation, the collating sequence is
that of sort -b; with -t, the sequence is a plain sort.
The conventions used by join conflict with those used by
sort (1), comm (1), uniq (1), and awk (1).
Numeric filenames may cause problems when you use the -o
option just before listing filenames.
RELATED INFORMATION
awk (1), comm (1), sort (1), uniq (1).
JOIN-2 Printed 6/10/85