- 论坛徽章:
- 5
|
本帖最后由 blackold 于 2011-03-01 18:08 编辑
回复 5# camelly
"不效"?? 拜托,要注意措辞。
我的测试: $ head a b
==> a <==
RNC;Date/Time ;RACK;Object ;pmCapacityAllocRej ;pmSamplesCapacity ;pmSumCapacity
WHRNC01;2011-03-01 03:15;ES-1;Licensing=1,RncCapacity=IubThroughput; 0; 900; 31558430
==> b <==
RNC;RACK;VALUE
WHRNC01;250000;ES-1
WHRNC01;400000;ES-2
WHRNC01;250000;ES-3
$ awk 'BEGIN{OFS=FS=";"}NR==FNR{if(NR==1)a[$1,$2]=$3;else a[$1,$3]=$2;next}FNR>1{cmd="date -d \""$2" UTC\" \"+%Y-%m-%d %H:%
M\"";cmd|getline $2;close(cmd)}{$4=$4";"a[$1,$3]}1' b a
RNC;Date/Time ;RACK;Object ;VALUE;pmCapacityAllocRej ;pmSamplesCapacity ;pmSumCapacity
WHRNC01;2011-03-01 11:15;ES-1;Licensing=1,RncCapacity=IubThroughput;250000; 0; 900; 31558430
我上面说了,可能你把字段的对应关系搞错了(没见你回复)。 |
|