Re: incorrect output from JOIN

Jim Meyering <[email protected]> Fri, 06 Dec 2002 13:06:31 +0100
Newsgroups gmane.comp.gnu.textutils.bugs
Message-ID <[email protected]>
Barry Gould <[email protected]> wrote:
> I'm a bit confused as I would have assumed that if both files were
> sorted in the same manner, then join shouldn't have any reason to have
> trouble with them.

Thanks for the report, but that's the way it's required to work.
Join requires that both inputs be sorted (a la `sort -b') on the field
on which you're joining.  The manual says this (note the last sentence below):

     `join' writes to standard output a line for each pair of input lines
  that have identical join fields.  Synopsis:

       join [OPTION]... FILE1 FILE2

     Either FILE1 or FILE2 (but not both) can be `-', meaning standard
  input.  FILE1 and FILE2 should be sorted on the join fields.