- 论坛徽章:
- 145
|
本帖最后由 jason680 于 2016-07-26 23:06 编辑
回复 6# txnet
b => k
i => n
$ awk 'function DBGprint(){print "NR="NR", k=\""k"\", a[k]=\""a[k]"\", c[k]=\""c[k]"\""}{k=$1" "$2" "$3;a[k]=a[k]?a[k]","$4:" "$4;c[k]=c[k]" "$5;DBGprint()}END{print "--- END ---";for(n in a)print n,a[n],c[n]}' 1.txt
NR=1, k="120.192.198.48 /default.php 2794", a[k]=" 20", c[k]=" 9"
NR=2, k="120.192.198.48 /in/missing.php 15557", a[k]=" 1", c[k]=" 74"
NR=3, k="120.192.198.48 /in/missing.php 15557", a[k]=" 1,2", c[k]=" 74 "
NR=4, k="120.196.118.116 /default.php 952", a[k]=" 1", c[k]=" 2"
--- END ---
120.192.198.48 /in/missing.php 15557 1,2 74
120.192.198.48 /default.php 2794 20 9
120.196.118.116 /default.php 952 1 2
|
|