Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ join(1) — Ultrix-32 3.1D RISC

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

awk(1)

comm(1)

sort(1)

join(1)

NAME

join − join files

SYNTAX

join [options] file1 file2

DESCRIPTION

The join command forms, on the standard output, a join of the two relations specified by the lines of file1 and file2. That is, all data in file1 that has the same join field as the corresponding line in file2 is combined and written to standard output.

Both file1 and file2 must be sorted in increasing ASCII collating sequence on the fields on which they are to be joined. 

If file1 is ‘−’, the standard input is used. 

The default operation causes one line of combined data to be output for each pair of lines in file1 and file2 that have identical join fields.  The output line consists of the common field, then the rest of the line from file1, then the rest of the line from file2. This operation can be modified using the options described below.

Fields are normally separated by blank, tab or new line.  In this case, multiple separators count as one, and leading separators are discarded.  You can join files with a maximum of 50 fields. 

The default join field is field 1 of each file. 

OPTIONS

−anProduces an additional line for unpaired lines from specified file n, where n is 1 or 2. 

−e sUses specified replacement string for all empty output fields.  The −e option should be used with the −o option to specify fields that do not appear in a line. 

−jn mDefines field m in file n to be the field used for the join operation.  If n is missing, then the mth field in each file is used.

−o listOutput the joined data according to the output list specification (see below). 

−tcSets tab character.  Every appearance of c in a line is significant. 

An output list specifies which fields from which files should be printed for each joined relation as well as the order in which those fields should be printed.  By default, if the specified output field does not exist (as is often the case in failed joins), then nothing is output for that item in the output list; the -e option can be used to change this. 

The list consists of list of file/field specifiers of the form: n.m, where n is the file number and m is the field number to be output.  For instance, the output list -o 1.1 1.2 2.1 2.2, prints out the first and second fields of the first file followed by the first and second fields of the second file. 
 

RESTRICTIONS

With default field separation, the collating sequence is that of sort −b; with −t, the sequence is that of a plain sort. 

SEE ALSO

awk(1), comm(1), sort(1)
 
 

Commands

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026