File size: 528 Bytes
28e6c6f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python3
import sys

transcript = sys.argv[1]
new_transcript = sys.argv[2]


def right_fill(string):
    return str(int(100 * float(string))).rjust(7, "0")


ref_look_up_dict_end = {}
with open(transcript, "r") as f, open(new_transcript, "w") as g:
    ref_lines = f.readlines()
    for line in ref_lines:
        items = line.split(" ")
        line_1 = "AMI_" + "_".join(items[:3]) + "_" + "_".join([right_fill(i) for i in items[3:5]])
        line_2 = " ".join(items[5:])
        g.write(line_1 + " " + line_2)