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

Version Path
rbbt-util-5.8.7 share/rbbt_commands/tsv/unzip
rbbt-util-5.8.6 share/rbbt_commands/tsv/unzip
rbbt-util-5.8.4 share/rbbt_commands/tsv/unzip
rbbt-util-5.8.3 share/rbbt_commands/tsv/unzip
rbbt-util-5.8.2 share/rbbt_commands/tsv/unzip
rbbt-util-5.8.1 share/rbbt_commands/tsv/unzip
rbbt-util-5.8.0 share/rbbt_commands/tsv/unzip
rbbt-util-5.7.0 share/rbbt_commands/tsv/unzip
rbbt-util-5.6.17 share/rbbt_commands/tsv/unzip
rbbt-util-5.6.16 share/rbbt_commands/tsv/unzip
rbbt-util-5.6.15 share/rbbt_commands/tsv/unzip
rbbt-util-5.6.14 share/rbbt_commands/tsv/unzip
rbbt-util-5.6.13 share/rbbt_commands/tsv/unzip
rbbt-util-5.6.12 share/rbbt_commands/tsv/unzip