1

common ids

view story
linux-howto

http://www.unix.com – I have file1.txt Quote: 1 2 a 3 4 b 2 3 b 1 1 c 1 1 a I have file2.txt Quote: b a and I want to extract all the rows in file1.txt that have the same idsas file2.txt in the 3rd column in the file1.txt. so the output willl be Quote: 1 1 a 1 2 a 2 3 b 3 4 b I have tried Code: sort ${data}/13.txt > ${data}/13 sort -k3,3 ${data}/333.txt > ${data}/333 awk 'NR==FNR{a[$0];next}$3 in a' ${data}/13.txt ${data}/333.txt > ${data}/444 but (HowTos)