数据整理

#/use/bin/python #encoding=utf-8 filename="WinPMT.log" filename_1="WinPMT_stress.log" with open(filename_1,"w") as file_object_1: file_object_1.write(" ") with open(filename) as file_object: lines=file_object.readlines() for line in lines: if "Cycle:" in line: with open(filename_1,'a') as file_object_1: file_object_1.write('\n') file_object_1.write(line) elif "errors"in line : with open(filename_1,'a') as file_object_1: file_object_1.write(line)
posted @ 2018-10-16 10:58  Bambooboo  阅读(121)  评论(0编辑  收藏  举报