Joining 2 files and excluding word from third file

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











up vote
0
down vote

favorite












I have three files: file1, file2 and exl. Both file1 and file2 have two columns of content. The first column is the same in both files.



I want to join the content of both files using that column. That's easy using the join command. But there is a problem with the exl file: it contains some words, which I want the join command to ignore/delete.



Is there any way to do that with join or should I use awk instead?



file1:

A la

B lb

C lc

D something



file 2:

A ba

B bb

C another

D bd



exl:

something

nothing



result:

A la ba

B lb bb

C lc

D bd



I found this command on the internet and it does the work but I don't undestand how it works: sed -ie "$(sed 's:.*:s/&//ig:' exl.txt)" file2.txt









share







New contributor




Hammam Boutafant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    0
    down vote

    favorite












    I have three files: file1, file2 and exl. Both file1 and file2 have two columns of content. The first column is the same in both files.



    I want to join the content of both files using that column. That's easy using the join command. But there is a problem with the exl file: it contains some words, which I want the join command to ignore/delete.



    Is there any way to do that with join or should I use awk instead?



    file1:

    A la

    B lb

    C lc

    D something



    file 2:

    A ba

    B bb

    C another

    D bd



    exl:

    something

    nothing



    result:

    A la ba

    B lb bb

    C lc

    D bd



    I found this command on the internet and it does the work but I don't undestand how it works: sed -ie "$(sed 's:.*:s/&//ig:' exl.txt)" file2.txt









    share







    New contributor




    Hammam Boutafant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have three files: file1, file2 and exl. Both file1 and file2 have two columns of content. The first column is the same in both files.



      I want to join the content of both files using that column. That's easy using the join command. But there is a problem with the exl file: it contains some words, which I want the join command to ignore/delete.



      Is there any way to do that with join or should I use awk instead?



      file1:

      A la

      B lb

      C lc

      D something



      file 2:

      A ba

      B bb

      C another

      D bd



      exl:

      something

      nothing



      result:

      A la ba

      B lb bb

      C lc

      D bd



      I found this command on the internet and it does the work but I don't undestand how it works: sed -ie "$(sed 's:.*:s/&//ig:' exl.txt)" file2.txt









      share







      New contributor




      Hammam Boutafant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I have three files: file1, file2 and exl. Both file1 and file2 have two columns of content. The first column is the same in both files.



      I want to join the content of both files using that column. That's easy using the join command. But there is a problem with the exl file: it contains some words, which I want the join command to ignore/delete.



      Is there any way to do that with join or should I use awk instead?



      file1:

      A la

      B lb

      C lc

      D something



      file 2:

      A ba

      B bb

      C another

      D bd



      exl:

      something

      nothing



      result:

      A la ba

      B lb bb

      C lc

      D bd



      I found this command on the internet and it does the work but I don't undestand how it works: sed -ie "$(sed 's:.*:s/&//ig:' exl.txt)" file2.txt







      bash awk join





      share







      New contributor




      Hammam Boutafant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      Hammam Boutafant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      Hammam Boutafant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 3 mins ago









      Hammam Boutafant

      1




      1




      New contributor




      Hammam Boutafant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Hammam Boutafant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Hammam Boutafant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

























          active

          oldest

          votes











          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: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          Hammam Boutafant is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f476579%2fjoining-2-files-and-excluding-word-from-third-file%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Hammam Boutafant is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          Hammam Boutafant is a new contributor. Be nice, and check out our Code of Conduct.












          Hammam Boutafant is a new contributor. Be nice, and check out our Code of Conduct.











          Hammam Boutafant is a new contributor. Be nice, and check out our Code of Conduct.













           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f476579%2fjoining-2-files-and-excluding-word-from-third-file%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)