I want to compare two files based on the value of their first column:
file1
aaa 23 3
bbb 56 6
ccc 45 2
file2
bbb m a
aaa a m
ccc m m
The output file should be:
aaa a m
bbb m a
ccc m m
i.e., we need to print the 2nd and 3rd columns of the 2nd file with the first column order of first file.
Can anybody suggest an awk script for this?