File size: 584 Bytes
24aaa76 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | """R5 REF smoke test helper: copies a mix list and blanks the text of every 4th row (empty targets, as the clutter rows of mix_v1 have).
Usage: python ref_smoke_blank_labels.py <in.tsv> <out.tsv>"""
import sys
lines = open(sys.argv[1], encoding="utf-8").read().split("\n")
out = [lines[0]]
n = 0
for i, line in enumerate(lines[1:]):
if not line:
continue
f = line.split("\t")
if i % 4 == 0:
f[1] = ""
n += 1
out.append("\t".join(f))
open(sys.argv[2], "w", encoding="utf-8").write("\n".join(out) + "\n")
print("blanked", n, "of", len(out) - 1)
|