- 论坛徽章:
- 780
|
回复 5# sulaimani_yu
如果team集合记录比较多,建议放到一个单独的文件里。- awk -vt1="50008881" -vt2="50008898" 'BEGIN{team[t1];team[t2]} /user_count/{count=gensub(/[^@]*@([0-9]*).*/,"\\1",1);if(count!=0){s=$0;k=1}} k{s=s"\n"$0;if($0~/team@/){tid=gensub(/.*=([0-9]*).*/,"\\1",1);if(tid in team){print s;k=0}}}' i
- count:user_count@1400000166287=^@^@^@^@^@^@^@^A^_
- count:user_count@1400000166287=^@^@^@^@^@^@^@^A^_
- count:user_num@1382241122888=0^_
- info:team@1383533112230=50008898^_
- count:user_count@1398766330048=^@^@^@^@^@^@^@3^_
- count:user_count@1398766330048=^@^@^@^@^@^@^@3^_
- count:user_num@1398168030155=0^_
- info:team@1398168029628=50008881^_
复制代码- cat i
- count:user_count@1405330702789=^@^@^@^@^@^@^@^@^_
- count:user_num@1405123296208=0^_
- info:team@1405123296982=50000671^_
- ^^
- count:user_count@1400000166287=^@^@^@^@^@^@^@^A^_
- count:user_num@1382241122888=0^_
- info:team@1383533112230=50008898^_
- ^^
- count:user_count@1396901933090=^@^@^@^@^@^@^@^B^_
- count:user_num@1396901933433=0^_
- info:team@1396901933270=50021422^_
- ^^
- ROWKEY=14:10000012955^_
- count:user_count@1398766330048=^@^@^@^@^@^@^@3^_
- count:user_num@1398168030155=0^_
- info:team@1398168029628=50008881^_
- ^^
- ROWKEY=14:10000011267^_
- count:user_num@1396901933433=0^_
- info:team@1396901933270=50021422^_
复制代码 |
|