compare first column of 2 file : while second have 2 column but first have one column [duplicate]

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











up vote
1
down vote

favorite













This question is an exact duplicate of:



  • If column matches another file, print every line with match (awk/grep)

    3 answers



i have 2 file :



file 1:



abc
mno
pqd


file 2:



ump 10
abc 12
sfg 30
klp 45
mno 21
pqd 32
jkl 98
lkg 45


I want output like this:



abc 12
mno 21
pqd 32






share|improve this question













marked as duplicate by steeldriver, schily, Jeff Schaller, slm♦ Jul 11 at 13:28


This question was marked as an exact duplicate of an existing question.


















    up vote
    1
    down vote

    favorite













    This question is an exact duplicate of:



    • If column matches another file, print every line with match (awk/grep)

      3 answers



    i have 2 file :



    file 1:



    abc
    mno
    pqd


    file 2:



    ump 10
    abc 12
    sfg 30
    klp 45
    mno 21
    pqd 32
    jkl 98
    lkg 45


    I want output like this:



    abc 12
    mno 21
    pqd 32






    share|improve this question













    marked as duplicate by steeldriver, schily, Jeff Schaller, slm♦ Jul 11 at 13:28


    This question was marked as an exact duplicate of an existing question.
















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite












      This question is an exact duplicate of:



      • If column matches another file, print every line with match (awk/grep)

        3 answers



      i have 2 file :



      file 1:



      abc
      mno
      pqd


      file 2:



      ump 10
      abc 12
      sfg 30
      klp 45
      mno 21
      pqd 32
      jkl 98
      lkg 45


      I want output like this:



      abc 12
      mno 21
      pqd 32






      share|improve this question














      This question is an exact duplicate of:



      • If column matches another file, print every line with match (awk/grep)

        3 answers



      i have 2 file :



      file 1:



      abc
      mno
      pqd


      file 2:



      ump 10
      abc 12
      sfg 30
      klp 45
      mno 21
      pqd 32
      jkl 98
      lkg 45


      I want output like this:



      abc 12
      mno 21
      pqd 32




      This question is an exact duplicate of:



      • If column matches another file, print every line with match (awk/grep)

        3 answers









      share|improve this question












      share|improve this question




      share|improve this question








      edited Jul 11 at 11:45









      SivaPrasath

      3,68311636




      3,68311636









      asked Jul 11 at 11:44









      Saurabh Shukla

      83




      83




      marked as duplicate by steeldriver, schily, Jeff Schaller, slm♦ Jul 11 at 13:28


      This question was marked as an exact duplicate of an existing question.






      marked as duplicate by steeldriver, schily, Jeff Schaller, slm♦ Jul 11 at 13:28


      This question was marked as an exact duplicate of an existing question.






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          10
          down vote



          accepted










          Try join :



          # join <(sort file1) <(sort file2)
          abc 12
          mno 21
          pqd 32





          share|improve this answer






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            10
            down vote



            accepted










            Try join :



            # join <(sort file1) <(sort file2)
            abc 12
            mno 21
            pqd 32





            share|improve this answer



























              up vote
              10
              down vote



              accepted










              Try join :



              # join <(sort file1) <(sort file2)
              abc 12
              mno 21
              pqd 32





              share|improve this answer

























                up vote
                10
                down vote



                accepted







                up vote
                10
                down vote



                accepted






                Try join :



                # join <(sort file1) <(sort file2)
                abc 12
                mno 21
                pqd 32





                share|improve this answer















                Try join :



                # join <(sort file1) <(sort file2)
                abc 12
                mno 21
                pqd 32






                share|improve this answer















                share|improve this answer



                share|improve this answer








                edited Jul 11 at 12:21


























                answered Jul 11 at 11:48









                SivaPrasath

                3,68311636




                3,68311636












                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Displaying single band from multi-band raster using QGIS

                    How many registers does an x86_64 CPU actually have?