过滤相同的列
时间:2010-11-03 来源:expert1
本人的脚本
#!/bin/awk -f
# author :expert1
#date :2010-10-03 #name :test.awk #USAGE: awk -f test.awk book3 book3 NR==FNR{if(NF==2)a[$1];else a[$1$2$3] } NR>FNR{ for(i in a) { if (split(i,b,"/")>1) {if(($NF==b[1])||($NF==b[2]))print b[1]" / "b[2]"\t"$NF} else {if(($NF==i))print i"\t"$NF}
} } 原文链接http://bbs.chinaunix.net/viewthread.php?tid=1788951&extra=page%3D1%26amp%3Borderby%3Dviews%26amp%3Bfilter%3D2592000
# author :expert1
#date :2010-10-03 #name :test.awk #USAGE: awk -f test.awk book3 book3 NR==FNR{if(NF==2)a[$1];else a[$1$2$3] } NR>FNR{ for(i in a) { if (split(i,b,"/")>1) {if(($NF==b[1])||($NF==b[2]))print b[1]" / "b[2]"\t"$NF} else {if(($NF==i))print i"\t"$NF}
} } 原文链接http://bbs.chinaunix.net/viewthread.php?tid=1788951&extra=page%3D1%26amp%3Borderby%3Dviews%26amp%3Bfilter%3D2592000
相关阅读 更多 +