5

How to combine two files with awk

view full story
linux-howto

http://www.unix.com – Hi, everyone! I have two files, I want to combine them as follows: HTML Code: File1 AAAA 23 45 AAAB 44 56 AAAC 34 65 AAAD 34 87 File2 AAAA 34 54 AAAE 34 56 Combined file AAAA 23 45 34 54 AAAB 44 56 AAAC 34 65 AAAD 34 87 AAAE      34 56 I searched online, and just found merged file with same field value or joint two file in different columns. How should I combine two files according a key field, print record together when the key field has same value, otherwise, print in different rows. Thank you! (HowTos)