- 论坛徽章:
- 0
|
本帖最后由 luck_libiao 于 2010-06-12 11:43 编辑
有如下数据:
update ts_productorder set applytime5='20100612000000' where subscriberkey=50775650 and recid=3 and productorderkey5=999000000049281632;
update ts_productorder set applytime5='20100612000000' where subscriberkey=54016439 and recid=2 and productorderkey5=999000000049375891;
update ts_productorder set applytime1='20100612000000' where subscriberkey=53102121 and recid=3 and productorderkey1=999000000049347243;
update ts_productorder set applytime4='20100612000000' where subscriberkey=54022999 and recid=2 and productorderkey4=999000000049276174;
update ts_productorder set applytime2='20100612000000' where subscriberkey=55917492 and recid=3 and productorderkey2=999000000049426647;
update ts_productorder set applytime4='20100612000000' where subscriberkey=54852113 and recid=2 and productorderkey4=999000000049323308;
update ts_productorder set applytime4='20100612000000' where subscriberkey=53420560 and recid=2 and productorderkey4=999000000049330824;
update ts_productorder set applytime4='20100612000000' where subscriberkey=55434744 and recid=2 and productorderkey4=999000000049280350;
想要统计subscriberkey=后面的值是否存在重复的,并且输出各相同的值的统计数据!
如果不包含等号的话:
可以这样!
awk '{ a[$8]++} END{for (b in a) {print b,a} ' file
但是现在有个=号,又不想先将=给先去掉,是否有方法做呢?
看下之前的贴,都是说可以用[],但是我写成如下:
awk -F "[= ]" '{ a[$8]++} END{for (b in a) {print b,a} ' file
不成功
awk -F "[=\ ]" '{ a[$8]++} END{for (b in a) {print b,a} ' file也不成功,不知道如何是好! |
|