Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # coding: utf-8
- import re
- import sys
- lines = u''.join(open(sys.argv[1]))
- re = re.compile(r'(?m)<idnumber>\s+(\d+)\s+<value>\s+\d+')
- for m in re.finditer(lines):
- with open(u'{}.txt'.format(m.group(1)), 'w') as out:
- out.write(u"{}\n".format(m.group()))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement