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)
This commit is contained in:
M Bernt
2019-01-11 14:41:11 +01:00
parent b6e382df9c
commit b18aa199aa
+2 -2
View File
@@ -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))