- 论坛徽章:
- 145
|
回复 1# lilyok12345
define the changed value in ch3.txt by yourself
$ cat ch3.txt
1201,15
1001,10
$ cat FILE
8613302200008,460030902234084,1201,12,600101,2002-03-19 12:00:00,2013-06-29 22:00:50
8613302200009,460030918855095,1001,12,600101,2010-12-30 18:06:51,2011-09-12 05:30:21
$ awk 'BEGIN{FS=OFS=","}NR==FNR{a[$1]=$2;next}{if(a[$3]!="")$3=a[$3]}1' ch3.txt FILE
8613302200008,460030902234084,15,12,600101,2002-03-19 12:00:00,2013-06-29 22:00:50
8613302200009,460030918855095,10,12,600101,2010-12-30 18:06:51,2011-09-12 05:30:21
|
|