摘要: 转成txt格式最大年龄 1 BEGIN{2 FS="[()]";max=03 }4 {5 if(max<substr($4,6,2)){max=substr($4,6,2);name=substr($1,9)}6 }7 END{8 print max,name9 }综合小例子 1 #!/usr/bin/bash 2 #awk [ -F re] [parameter...] ['prog'] [-f progfile][in_file...] 3 # BEGIN { x=0 }/^$/{ x=x+1 }END{ print "I found & 阅读全文
posted @ 2012-12-06 18:46 hhhyde 阅读(113) 评论(0) 推荐(0) 编辑
摘要: View Code 1 #coding:utf-8 2 logpath='D:/temp2.log' 3 destinationPath='d:/temp.xml' 4 log=open(logpath) 5 # status={}#行数:{节点名:状态(1:不可用,2:可用)} 6 status={}#行数:{节点名:状态(1:不成对begin,2:不成对end,3:成对begin,4:成对end)} 7 content=[] 8 begins=[] 9 index=010 exist={}11 for r in log.readlines():12 inde 阅读全文
posted @ 2012-12-06 18:05 hhhyde 阅读(138) 评论(0) 推荐(0) 编辑