From 7347d75a4a36d42f8060e11d708291d796b266a5 Mon Sep 17 00:00:00 2001 From: Clayton Turner Date: Mon, 10 Feb 2014 16:00:30 -0500 Subject: [PATCH] Added ignore lines starting with specific characters to group tool --- tools/stats/grouping.py | 17 ++++++++++++++++- tools/stats/grouping.xml | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/tools/stats/grouping.py b/tools/stats/grouping.py index 084d5e253b3..0b2487fd0f9 100644 --- a/tools/stats/grouping.py +++ b/tools/stats/grouping.py @@ -37,7 +37,22 @@ def main(): round_val = [] data_ary = [] - for var in sys.argv[5:]: + if sys.argv[5] != "None": + oldfile = open(inputfile,'r') + oldfilelines = oldfile.readlines() + newinputfile = inputfile+'2' + 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 + + for var in sys.argv[6:]: op, col, do_round = var.split() ops.append(op) cols.append(col) diff --git a/tools/stats/grouping.xml b/tools/stats/grouping.xml index 9d7815ac7a2..252cdc3ece0 100644 --- a/tools/stats/grouping.xml +++ b/tools/stats/grouping.xml @@ -6,6 +6,7 @@ $input1 $groupcol $ignorecase + $ignorelines #for $op in $operations '${op.optype} ${op.opcol} @@ -18,6 +19,24 @@ + + + + + + + + + + + + + + + + + +