mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
21 lines
438 B
Python
Executable File
21 lines
438 B
Python
Executable File
#!/usr/bin/env python3
|
|
import re
|
|
import sys
|
|
|
|
filename = sys.argv[1]
|
|
out_filename = sys.argv[2]
|
|
inp = open(filename)
|
|
content = inp.read()
|
|
|
|
p = re.compile('( average: \d{1,3}\.\d{1,3})|(\w{2,9}\.test\d)')
|
|
matches = p.findall(content)
|
|
f = open(out_filename, 'w')
|
|
for i, match in enumerate(matches):
|
|
for s in match:
|
|
if s != "":
|
|
f.write(s)
|
|
if i % 2 != 0:
|
|
f.write("\n")
|
|
f.close()
|
|
inp.close()
|