


JOIN(1L)                                                 JOIN(1L)


NNAAMMEE
       join - join lines of two files on a common field

SSYYNNOOPPSSIISS
       jjooiinn  [-a  1|2]  [-v  1|2]  [-e  empty-string]  [-o field-
       list...] [-t char] [-j[1|2] field] [-1 field]  [-2  field]
       file1 file2
       jjooiinn {--help,--version}

DDEESSCCRRIIPPTTIIOONN
       This  manual page documents the GNU version of jjooiinn.  jjooiinn
       prints to the standard output a  line  for  each  pair  of
       input  lines,  one  each  from  _f_i_l_e_1 and _f_i_l_e_2, that have
       identical join fields.  Either filename (but not both) can
       be  `-',  meaning  the  standard  input.   _f_i_l_e_1 and _f_i_l_e_2
       should be already sorted in increasing order (not  numeri-
       cally)  on the join fields; unless the _-_t option is given,
       they should be sorted ignoring blanks at the start of  the
       line, as ssoorrtt does when given the _-_b option.

       The  defaults  are:  the  join field is the first field in
       each line; fields in the input are  separated  by  one  or
       more  blanks,  with  leading  blanks  on the line ignored;
       fields in the output are separated by a space; each output
       line consists of the join field, the remaining fields from
       _f_i_l_e_1, then the remaining fields from _f_i_l_e_2.

   OOPPTTIIOONNSS
       _-_a _f_i_l_e_-_n_u_m_b_e_r
              Print a line for each unpairable line in file _f_i_l_e_-
              _n_u_m_b_e_r  (either  1 or 2), in addition to the normal
              output.

       _-_e _s_t_r_i_n_g
              Replace empty output fields (those that are missing
              in the input) with _s_t_r_i_n_g.

       _-_1_, _-_j_1 _f_i_e_l_d
              Join on field _f_i_e_l_d (a positive integer) of file 1.

       _-_2_, _-_j_2 _f_i_e_l_d
              Join on field _f_i_e_l_d (a positive integer) of file 2.

       _-_j _f_i_e_l_d
              Equivalent to _-_1 _f_i_e_l_d _-_2 _f_i_e_l_d.

       _-_o _f_i_e_l_d_-_l_i_s_t_._._.
              Construct  each output line according to the format
              in _f_i_e_l_d_-_l_i_s_t.  Each element in _f_i_e_l_d_-_l_i_s_t consists
              of  a  file number (either 1 or 2), a period, and a
              field number (a positive integer).  The elements in
              the list are separated by commas or blanks.  Multi-
              ple _f_i_e_l_d_-_l_i_s_t arguments can be given after a  sin-
              gle  _-_o  option; the values of all lists given with



FSF                     GNU Text Utilities                      1





JOIN(1L)                                                 JOIN(1L)


              _-_o are concatenated together.

       _-_t _c_h_a_r
              Use character _c_h_a_r as the input  and  output  field
              separator.

       _-_v _f_i_l_e_-_n_u_m_b_e_r
              Print a line for each unpairable line in file _f_i_l_e_-
              _n_u_m_b_e_r (either 1 or 2), instead of the normal  out-
              put.

       In  addition,  when  GNU  jjooiinn is invoked with exactly one
       argument, the following options are recognized:

       _-_-_h_e_l_p Print a usage message on standard output  and  exit
              successfully.

       _-_-_v_e_r_s_i_o_n
              Print  version  information on standard output then
              exit successfully.





































FSF                     GNU Text Utilities                      2


