From 3b2fe57c7d7bf7ecc1e19d112f7ddd63b0eb7139 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 8 Jul 2014 17:14:26 +0200 Subject: misc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/extract/cut | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/extract/cut') diff --git a/src/extract/cut b/src/extract/cut index fa6cb99..7399b7f 100755 --- a/src/extract/cut +++ b/src/extract/cut @@ -36,7 +36,7 @@ while i < n: delimiter = sys.argv[i] elif arg == '-f': i += 1 - fields += [int(f) for f in sys.argv[i].split(',')] + fields += [int(f) - 1 for f in sys.argv[i].split(',')] elif arg == '--complement': complement = True i += 1 @@ -47,7 +47,7 @@ fields = set(fields) def modify(line): line = line.split(delimiter) - if not complement: + if complement: line = [line[i] for i in range(len(line)) if i not in fields] else: line = [line[i] for i in range(len(line)) if i in fields] -- cgit v1.2.3-70-g09d2