Re: join not joining more then 9 lines

cbaker_at_GOODYEAR.COM
Date: 10/26/04

  • Next message: Andrew Townsend: "Re: join not joining more then 9 lines"
    Date:         Tue, 26 Oct 2004 12:42:53 -0400
    To: aix-l@Princeton.EDU
    
    

    Simon beat me to the answer.... That is what I get for eating lunch :o)

    That is exactly the issue. The field used for the join index must be sorted such as "sort -b"..... Not "sort -n".

    If you sort -b the two files first and put the output to two new files and then join them, you will see all 15 lines this time.

    Hope that helps,

    Christopher M. Baker
    Senior Technical Support Analyst
    DSE/TCO
    Goodyear Tire and Rubber Company

    =================================================
    Contains Confidential and/or Proprietary Information.
    May not be copied or disseminated without the expressed
    written consent of The Goodyear Tire & Rubber Company.
    =================================================

                 "Green, Simon"
                 <Simon.Green@EU.ALTRIA.COM>
                 Sent by: IBM AIX Discussion List To
                 <aix-l@Princeton.EDU> aix-l@Princeton.EDU
                                                                                                                                       cc

                 10/26/04 12:13 PM Subject
                                                                   Re: join not joining more then 9 lines

                             Please respond to
                          IBM AIX Discussion List
                           <aix-l@Princeton.EDU>

    I think the problem is that join assumes alphabetic, not numeric sequence.
    So "10" is less than "9" and it gives up in disgust. The man page for join
    would suggest that you need to do a normal sort - just sort, or sort -b -
    before you do your join. If you need it in numeric order, do a sort -n on
    the result.

    --
    Simon Green
    Altria ITSC Europe Ltd
    AIX-L Archive at https://new-lists.princeton.edu/listserv/aix-l.html
    New to AIX? http://publib-b.boulder.ibm.com/redbooks.nsf/portals/UNIX
    N.B. Unsolicited email from vendors will not be appreciated.
    Please post all follow-ups to the list.
    > -----Original Message-----
    > From: IBM AIX Discussion List [mailto:aix-l@Princeton.EDU] On
    > Behalf Of Andrew Townsend
    > Sent: 26 October 2004 15:46
    > To: aix-l@Princeton.EDU
    > Subject: Re: join not joining more then 9 lines
    >
    >
    > I try to join 2 files but join will only join the first 9
    > lines. The two
    > files I am trying to join are:
    >
    > # cat tot-data-BU.041025
    >      1  Backedup
    >      2  0.647
    >      3  0.756
    >      4  1.576
    >      5  2.191
    >      6  2.560
    >      7  3.300
    >      8  3.770
    >      9  4.629
    >     10  5.024
    >     11  5.887
    >     12  6.783
    >     13  7.386
    >     14  7.953
    >     15  8.533
    >
    > and
    >
    > #cat tot-data-RES.041025
    >      1  Restored
    >      2  0.0
    >      3  0.0
    >      4  0.0
    >      5  0.0051
    >      6  0.0051
    >      7  0.0051
    >      8  0.0051
    >      9  0.0101
    >     10  0.0101
    >     11  0.0101
    >     12  0.0101
    >     13  0.0101
    >     14  0.0101
    >     15  0.0101
    >
    > when I do a      join tot-data-BU.041025  tot-data-RES.041025
    > I get:
    >
    > 1 Backedup Restored
    > 2 0.647 0.0
    > 3 0.756 0.0
    > 4 1.576 0.0
    > 5 2.191 0.0051
    > 6 2.560 0.0051
    > 7 3.300 0.0051
    > 8 3.770 0.0051
    > 9 4.629 0.0101
    >
    > Only 9 lines! Is this a limitation of join, or is it something with my
    > output?
    

  • Next message: Andrew Townsend: "Re: join not joining more then 9 lines"

    Relevant Pages