Sha256: 41f4440d27a54e398db4afe2c259c08489910465ee134d5d3472ae2ba3e3c8aa
Contents?: true
Size: 667 Bytes
Versions: 14
Compression:
Stored size: 667 Bytes
Contents
#!/usr/bin/env ruby require 'rbbt-util' require 'rbbt/util/simpleopt' options = SOPT.get("-tch--tokyocabinet:-tcb--tokyocabinet_bd:-f--field Field to append to key:-m--merge Consider multiple values even after unzip") file = ARGV.shift file = STDIN if file == '-' field = options[:field] || 0 merge = options[:merge] || false case when options[:tokyocabinet] tsv = Persist.open_tokyocabinet(file, false) when options[:tokyocabinet_bd] tsv = Persist.open_tokyocabinet(file, false, nil, TokyoCabinet::BDB) else if String === file file = file.dup Path.setup(File.expand_path(file)) end tsv = TSV.open(file) end puts tsv.unzip(field, merge).to_s
Version data entries
14 entries across 14 versions & 1 rubygems