[root]# cat file1.txt
20141101,R,C,S,9189349593,CNY,90.5,0,,,
20141101,R,C,S,29497223258,CNY,23.99,0,,,
20141101,R,C,S,7282528635,CNY,38.41,0,,,
20141101,R,C,S,1541305105,CNY,126.49,0,,,
20141101,R,C,S,4096074803,CNY,126,0,,,
20141101,R,C,S,19497016021,CNY,3.5,0,,,
20141101,R,C,S,9823684073,CNY,66.7,0,,,
[root]# cat file2.txt
9189349593 1058642797902
29497223258 568040114061
7282528635 690149897144
1541305105 690105043194
[root]# awk -F '[, ]+' 'FNR==NR{a[$1]=$2;next}{if($5 in a) print $0,a[$5]}' file2.txt file1.txt
20141101,R,C,S,9189349593,CNY,90.5,0,,, 1058642797902
20141101,R,C,S,29497223258,CNY,23.99,0,,, 568040114061
20141101,R,C,S,7282528635,CNY,38.41,0,,, 690149897144
20141101,R,C,S,1541305105,CNY,126.49,0,,, 690105043194
|