Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Unix awk command

  • 01-04-2012 9:05pm
    #1
    Registered Users, Registered Users 2 Posts: 845 ✭✭✭


    Hi,
    Looking for some help on an awk command to merge two file together, would really appreciate seom guidance. I have 2 files like this....

    file1.txt

    1 a
    2 b
    3 c
    4 d
    5 e
    6 f
    7 g
    8 h
    9 i

    file2.txt

    1 j
    3 k
    5 l
    7 m
    9 n

    I'd like to merge the two files together - listing all the values from both columns of file1 as well as the values from the 2nd column of file2 where the first column matches file1 - so you end up with this.....

    output...

    1 a j
    2 b
    3 c k
    4 d
    5 e l
    6 f
    7 g m
    8 h
    9 i n

    Any idea on quick awk command to do this?

    thanks in advance


Comments

Advertisement