- 论坛徽章:
- 2
|
本帖最后由 yinyuemi 于 2011-07-26 23:20 编辑
回复 1# physpy - $ awk 'NR==FNR{for(i=2;i<=NF;i++)a[NR,i]=substr($i,1,index($i,".")+1);b[NR]=$0;next}{l=0;for(i=2;i<=NF;i++){m=substr($i,1,index($i,".")+1);l+=(a[FNR,i]-m)};if(l!=0)print "file1: "b[FNR] RS "file2: "$0}' 1 2
- file1: 7 188.413 86.427 1614997.875 0.107 1.082
- file2: 7 188.413 86.427 1614997.750 0.107 1.082
- file1: 8 229.744 105.155 1243784.625 0.122 0.986
- file2: 8 229.744 105.155 1243784.500 0.122 0.986
- file1: 13 318.878 145.539 3524.290 12.069 0.925
- file2: 13 318.878 145.539 3524.311 12.069 0.925
复制代码 |
|