Join problem: throwing error, join extra operand

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I want to join 3 files on a column which has sorted unique numeric values (those files have only one column of values though) and starts with same prefix for an example "usi".



Now, while I am doing this



join -j 1 ../Test_Data/usi* > ../Test_Data/join_output.txt


I am finding following error:




join: extra operand `usi_rtree_lw_100000.txt'
Try `join --help' for more information.



Any ideas?










share|improve this question



























    up vote
    2
    down vote

    favorite












    I want to join 3 files on a column which has sorted unique numeric values (those files have only one column of values though) and starts with same prefix for an example "usi".



    Now, while I am doing this



    join -j 1 ../Test_Data/usi* > ../Test_Data/join_output.txt


    I am finding following error:




    join: extra operand `usi_rtree_lw_100000.txt'
    Try `join --help' for more information.



    Any ideas?










    share|improve this question

























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I want to join 3 files on a column which has sorted unique numeric values (those files have only one column of values though) and starts with same prefix for an example "usi".



      Now, while I am doing this



      join -j 1 ../Test_Data/usi* > ../Test_Data/join_output.txt


      I am finding following error:




      join: extra operand `usi_rtree_lw_100000.txt'
      Try `join --help' for more information.



      Any ideas?










      share|improve this question















      I want to join 3 files on a column which has sorted unique numeric values (those files have only one column of values though) and starts with same prefix for an example "usi".



      Now, while I am doing this



      join -j 1 ../Test_Data/usi* > ../Test_Data/join_output.txt


      I am finding following error:




      join: extra operand `usi_rtree_lw_100000.txt'
      Try `join --help' for more information.



      Any ideas?







      text-processing join






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 18 at 21:12









      don_crissti

      48.7k15129157




      48.7k15129157










      asked Oct 22 '12 at 3:45









      MiNdFrEaK

      69451423




      69451423




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          3
          down vote













          join accepts only 2 files to join. To operate on 3 file you have to use 2 join calls:



          join -j 1 <(join -j 1 ../Test_Data/usi-1 ../Test_Data/usi-2) ../Test_Data/usi-3 > ../Test_Data/join_output.txt


          The above command requires bash, as uses process substitution. If you use another shell, please specify which.



          Update according to the comment.

          If you know only a file name pattern instead of exact file names, let the shell expand the pattern, capture the expanded list in an array then use the array elements as parameters:



          file=(../Test_Data/usi*)
          join -j 1 <(join -j 1 "$file[0]" "$file[1]") "$file[2]"





          share|improve this answer






















          • actually the problem is , I know only the prefixes of the files,I cant use the exact names of them.
            – MiNdFrEaK
            Oct 22 '12 at 7:54

















          up vote
          0
          down vote













          POSIX shell variants of manatwork's answer:



          1. printf '"%s" ' ../Test_Data/usi* | read a b c ; join $a $b


          2. set -- ../Test_Data/usi* ; join "$1" "$2" | join - "$3"






          share|improve this answer




















            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f52528%2fjoin-problem-throwing-error-join-extra-operand%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            3
            down vote













            join accepts only 2 files to join. To operate on 3 file you have to use 2 join calls:



            join -j 1 <(join -j 1 ../Test_Data/usi-1 ../Test_Data/usi-2) ../Test_Data/usi-3 > ../Test_Data/join_output.txt


            The above command requires bash, as uses process substitution. If you use another shell, please specify which.



            Update according to the comment.

            If you know only a file name pattern instead of exact file names, let the shell expand the pattern, capture the expanded list in an array then use the array elements as parameters:



            file=(../Test_Data/usi*)
            join -j 1 <(join -j 1 "$file[0]" "$file[1]") "$file[2]"





            share|improve this answer






















            • actually the problem is , I know only the prefixes of the files,I cant use the exact names of them.
              – MiNdFrEaK
              Oct 22 '12 at 7:54














            up vote
            3
            down vote













            join accepts only 2 files to join. To operate on 3 file you have to use 2 join calls:



            join -j 1 <(join -j 1 ../Test_Data/usi-1 ../Test_Data/usi-2) ../Test_Data/usi-3 > ../Test_Data/join_output.txt


            The above command requires bash, as uses process substitution. If you use another shell, please specify which.



            Update according to the comment.

            If you know only a file name pattern instead of exact file names, let the shell expand the pattern, capture the expanded list in an array then use the array elements as parameters:



            file=(../Test_Data/usi*)
            join -j 1 <(join -j 1 "$file[0]" "$file[1]") "$file[2]"





            share|improve this answer






















            • actually the problem is , I know only the prefixes of the files,I cant use the exact names of them.
              – MiNdFrEaK
              Oct 22 '12 at 7:54












            up vote
            3
            down vote










            up vote
            3
            down vote









            join accepts only 2 files to join. To operate on 3 file you have to use 2 join calls:



            join -j 1 <(join -j 1 ../Test_Data/usi-1 ../Test_Data/usi-2) ../Test_Data/usi-3 > ../Test_Data/join_output.txt


            The above command requires bash, as uses process substitution. If you use another shell, please specify which.



            Update according to the comment.

            If you know only a file name pattern instead of exact file names, let the shell expand the pattern, capture the expanded list in an array then use the array elements as parameters:



            file=(../Test_Data/usi*)
            join -j 1 <(join -j 1 "$file[0]" "$file[1]") "$file[2]"





            share|improve this answer














            join accepts only 2 files to join. To operate on 3 file you have to use 2 join calls:



            join -j 1 <(join -j 1 ../Test_Data/usi-1 ../Test_Data/usi-2) ../Test_Data/usi-3 > ../Test_Data/join_output.txt


            The above command requires bash, as uses process substitution. If you use another shell, please specify which.



            Update according to the comment.

            If you know only a file name pattern instead of exact file names, let the shell expand the pattern, capture the expanded list in an array then use the array elements as parameters:



            file=(../Test_Data/usi*)
            join -j 1 <(join -j 1 "$file[0]" "$file[1]") "$file[2]"






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Oct 22 '12 at 8:02

























            answered Oct 22 '12 at 6:30









            manatwork

            21.4k38284




            21.4k38284











            • actually the problem is , I know only the prefixes of the files,I cant use the exact names of them.
              – MiNdFrEaK
              Oct 22 '12 at 7:54
















            • actually the problem is , I know only the prefixes of the files,I cant use the exact names of them.
              – MiNdFrEaK
              Oct 22 '12 at 7:54















            actually the problem is , I know only the prefixes of the files,I cant use the exact names of them.
            – MiNdFrEaK
            Oct 22 '12 at 7:54




            actually the problem is , I know only the prefixes of the files,I cant use the exact names of them.
            – MiNdFrEaK
            Oct 22 '12 at 7:54












            up vote
            0
            down vote













            POSIX shell variants of manatwork's answer:



            1. printf '"%s" ' ../Test_Data/usi* | read a b c ; join $a $b


            2. set -- ../Test_Data/usi* ; join "$1" "$2" | join - "$3"






            share|improve this answer
























              up vote
              0
              down vote













              POSIX shell variants of manatwork's answer:



              1. printf '"%s" ' ../Test_Data/usi* | read a b c ; join $a $b


              2. set -- ../Test_Data/usi* ; join "$1" "$2" | join - "$3"






              share|improve this answer






















                up vote
                0
                down vote










                up vote
                0
                down vote









                POSIX shell variants of manatwork's answer:



                1. printf '"%s" ' ../Test_Data/usi* | read a b c ; join $a $b


                2. set -- ../Test_Data/usi* ; join "$1" "$2" | join - "$3"






                share|improve this answer












                POSIX shell variants of manatwork's answer:



                1. printf '"%s" ' ../Test_Data/usi* | read a b c ; join $a $b


                2. set -- ../Test_Data/usi* ; join "$1" "$2" | join - "$3"







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 18 at 21:00









                agc

                4,43311035




                4,43311035



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f52528%2fjoin-problem-throwing-error-join-extra-operand%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown






                    Popular posts from this blog

                    Peggy Mitchell

                    The Forum (Inglewood, California)

                    Palaiologos