home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / GNUTUE.ZIP / man / join.man < prev    next >
Text File  |  1992-07-18  |  3KB  |  60 lines

  1. NAME
  2.      join - join lines of two files on a common field
  3.  
  4. SYNOPSIS
  5.      join [-a 1|2] [-v 1|2] [-e empty-string]  [-o  field-list...]  [-t  char]
  6.      [-j[1|2] field] [-1 field] [-2 field] file1 file2
  7.  
  8. DESCRIPTION
  9.      This manual page documents the GNU version of join.  join prints  to  the
  10.      standard  output a line for each pair of input lines, one each from file1
  11.      and file2, that have identical join fields.   Either  filename  (but  not
  12.      both)  can be `-', meaning the standard input.  file1 and file2 should be
  13.      already sorted in increasing order (not numerically) on the join  fields;
  14.      unless  the  -t option is given, they should be sorted ignoring blanks at
  15.      the start of the line, as sort does when given the -b option.
  16.  
  17.      The defaults are: the join field is the first field in each line;  fields
  18.      in  the input are separated by one or more blanks, with leading blanks on
  19.      the line ignored; fields in the output are separated  by  a  space;  each
  20.      output  line consists of the join field, the remaining fields from file1,
  21.      then the remaining fields from file2.
  22.  
  23.      OPTIONS
  24.  
  25.      -a file-number
  26.           Print a line for each unpairable line in file file-number (either  1
  27.           or 2), in addition to the normal output.
  28.  
  29.      -e string
  30.           Replace empty output fields (those that are missing  in  the  input)
  31.           with string.
  32.  
  33.      -1, -j1 field
  34.           Join on field field (a positive integer) of file 1.
  35.  
  36.      -2, -j2 field
  37.           Join on field field (a positive integer) of file 2.
  38.  
  39.      -j field
  40.           Equivalent to -1 field -2 field.
  41.  
  42.      -o field-list...
  43.           Construct each output line according to the  format  in  field-list.
  44.           Each  element  in  field-list consists of a file number (either 1 or
  45.           2), a period, and a field number (a positive integer).  The elements
  46.           in  the list are separated by commas or blanks.  Multiple field-list
  47.           arguments can be given after a single -o option; the values  of  all
  48.           lists given with -o are concatenated together.
  49.  
  50.      -t char
  51.           Use character char as the input and output field separator.
  52.  
  53.      -v file-number
  54.           Print a line for each unpairable line in file file-number (either  1
  55.           or 2), instead of the normal output.
  56.  
  57.      The long-named options can be introduced with `+' as well  as  `--',  for
  58.      compatibility with previous releases.  Eventually support for `+' will be
  59.      removed, because it is incompatible with the POSIX.2 standard.
  60.