diff options
Diffstat (limited to 'skate/reduce.go')
-rw-r--r-- | skate/reduce.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/skate/reduce.go b/skate/reduce.go index 9986152..eac2e83 100644 --- a/skate/reduce.go +++ b/skate/reduce.go @@ -598,10 +598,14 @@ func Cut(line string, column int) string { // CutSep allows to specify a separator, column is 1-indexed. func CutSep(line, sep string, column int) string { - parts := strings.Split(strings.TrimSpace(line), sep) + // XXX: This will cut the tab separator, if there is no other value. + parts := strings.Split(line, sep) if len(parts) < column { return "" } else { + if len(parts) == column { + return strings.TrimSuffix(parts[column-1], "\n") + } return parts[column-1] } } |