1

extract columns by matching ids in two files

view story
linux-howto

http://www.unix.com – Hello, I want to extract columns from file2 to file3 by matching ids between file1 and file2. The extracted columns should be in same order as file1 ids. for example: file1.txt 1823 607 R2A9 802 771 file2.txt 1823 1 2 4 22 11 4 29 607 12 3 3 R2A9 34 4 9 D33 2 1 0 802 30 8 1 771 3 0 9 3RE 6 3 1 output file3.txt should be printed in this way 1823 1 2 4 607 12 3 3 R2A9 34 4 9 802 30 8 1 771 3 0 9 Please suggest me something. Thanks, (HowTos)