awk 查重复数据脚本

cat imsi2phone.txt|awk '{a[$2]++;if(a[$2]>1){print $1}else{b[$2]=$1}}END{for(c in b){if(a[c]>1){print b[c]}}}'|wc -l


A               B
460001992158261 8613711921591
460001952196579 8613711921591
460001992158261 8613711921592
460001952196579 8613711921593

查B重复的A

你可能感兴趣的:(awk)