diff --git a/tools/stats/grouping.py b/tools/stats/grouping.py index 1a01205bd93..c65992b466a 100644 --- a/tools/stats/grouping.py +++ b/tools/stats/grouping.py @@ -38,19 +38,20 @@ def main(): round_val = [] if sys.argv[5] != "None": - oldfile = open(inputfile, 'r') - oldfilelines = oldfile.readlines() - newinputfile = "input_cleaned.tsv" - newfile = open(newinputfile, 'w') - asciitodelete = sys.argv[5].split(',') - for i in range(len(asciitodelete)): - asciitodelete[i] = chr(int(asciitodelete[i])) - for line in oldfilelines: - if line[0] not in asciitodelete: - newfile.write(line) - oldfile.close() - newfile.close() - inputfile = newinputfile + asciitodelete = sys.argv[5] + if asciitodelete: + oldfile = open(inputfile, 'r') + newinputfile = "input_cleaned.tsv" + newfile = open(newinputfile, 'w') + asciitodelete = asciitodelete.split(',') + for i in range(len(asciitodelete)): + asciitodelete[i] = chr(int(asciitodelete[i])) + for line in oldfile: + if line[0] not in asciitodelete: + newfile.write(line) + oldfile.close() + newfile.close() + inputfile = newinputfile for var in sys.argv[6:]: op, col, do_round = var.split() diff --git a/tools/stats/grouping.xml b/tools/stats/grouping.xml index 58a9c7524ae..a4e646d648c 100644 --- a/tools/stats/grouping.xml +++ b/tools/stats/grouping.xml @@ -1,12 +1,12 @@ - + data by a column and perform aggregate operation on other columns. grouping.py - $out_file1 - $input1 - $groupcol - $ignorecase - $ignorelines + "${out_file1}" + "${input1}" + "${groupcol}" + "${ignorecase}" + "${ignorelines}" #for $op in $operations '${op.optype} ${op.opcol}