Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import sys
- id = sys.argv[1]
- dat = sys.argv[2]
- abn = dat.replace(".dat",".abn")
- with open(dat) as f:
- lines = f.readlines()
- mylines = [i+1 for i, line in enumerate(lines) if id in line]
- with open(abn, "r+b") as b:
- j = 0
- while True:
- j += 1
- d = b.read(1)
- if len(d) == 0:
- while j <= len(lines):
- if j in mylines:
- b.write(b"\x08")
- else:
- b.write(b"\x00")
- j += 1
- break
- if j in mylines:
- b.write(b"\x08")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement