aboutsummaryrefslogtreecommitdiff
path: root/ldcg-onednn-benchmarks/format-for-json.py
blob: 6720efbed012083bb2af0c89d51a3217d0a2e368 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python3

import sys

resultsfile = sys.argv[1]
workspace = sys.argv[2]

with open(workspace + '/' +  resultsfile, 'r') as handle:
    pippo = handle.readlines()

with open(workspace + "/final_" + resultsfile, 'w+') as whandle:
    for i in range(0, len(pippo)):
        line = pippo[i]
        if i != 0 and i != (len(pippo)-2) and i != len(pippo)-1:
            whandle.write(line[:len(line)-1] +  ',' + '\n')
        else:
            whandle.write(line)