From b18aa199aa57e87ef62013f5c4542f7491ec9b19 Mon Sep 17 00:00:00 2001 From: M Bernt Date: Fri, 11 Jan 2019 14:41:11 +0100 Subject: [PATCH] group: don't remove empty cells at the begin/start of lines currently group removes empty cells at the begin and end of lines additionally the sort command line is changed (hoping that this looks a bit more obvious) --- tools/stats/grouping.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/stats/grouping.py b/tools/stats/grouping.py index ad9038de1b4..e4379576a20 100644 --- a/tools/stats/grouping.py +++ b/tools/stats/grouping.py @@ -115,7 +115,7 @@ def main(): case = '' if ignorecase == 1: case = '-f' - command_line = "sort -t ' ' %s -k%s,%s -o %s %s" % (case, group_col + 1, group_col + 1, tmpfile.name, inputfile) + command_line = "sort -t $'\\t' %s -k%s,%s -o %s %s" % (case, group_col + 1, group_col + 1, tmpfile.name, inputfile) except Exception as exc: stop_err('Initialization error -> %s' % str(exc)) @@ -128,7 +128,7 @@ def main(): def is_new_item(line): try: - item = line.strip().split("\t")[group_col] + item = line.split("\t")[group_col] except IndexError: stop_err("The following line didn't have %s columns: %s" % (group_col + 1, line))