- 论坛徽章:
- 4
|
本帖最后由 mswsg 于 2016-05-05 17:59 编辑
我怎么看到多了2000 ?- __author__ = 'shengwei ma'
- __author_email__ = 'shengweima@icloud.com'
- import re
- with open('1.txt', 'r') as f:
- for line in f.readlines():
- line = line.strip().split()
- if '4000000' in line[2]:
- new = re.sub('4000000', '3000818', line[2])
- print('\t'.join(line[:2]) + '\t' + new, '\t'.join(line[3:]))
复制代码 结果
PZ1-01-1425609646.328 3 30008182000 1425609704 1425609748 44 2008 xx 2015-03-06 02:42:28.973+00
PZ1-01-1426480458.1418 3 30008182000 1426480501 1426480520 19 2233 xxx 2015-03-16 04:35:20.207+0 |
|