aboutsummaryrefslogtreecommitdiffstats
path: root/src/extract/cut
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-07-08 17:14:26 +0200
committerMattias Andrée <maandree@operamail.com>2014-07-08 17:14:26 +0200
commit3b2fe57c7d7bf7ecc1e19d112f7ddd63b0eb7139 (patch)
tree7c6cf8ae63d836b290942ef18d121483cf2eca18 /src/extract/cut
parenttypo + grammaro (diff)
downloadlibgamma-3b2fe57c7d7bf7ecc1e19d112f7ddd63b0eb7139.tar.gz
libgamma-3b2fe57c7d7bf7ecc1e19d112f7ddd63b0eb7139.tar.bz2
libgamma-3b2fe57c7d7bf7ecc1e19d112f7ddd63b0eb7139.tar.xz
misc
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rwxr-xr-xsrc/extract/cut4
1 files changed, 2 insertions, 2 deletions
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]