Sha256: 96331f8232e0d2dcfcb17a34772d24d0489beccb11cff44da2c31fdbb1b035b5

Contents?: true

Size: 685 Bytes

Versions: 28

Compression:

Stored size: 685 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, :type => :double)
end

puts tsv.unzip(field, merge).to_s

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
rbbt-util-5.12.1 share/rbbt_commands/tsv/unzip
rbbt-util-5.12.0 share/rbbt_commands/tsv/unzip
rbbt-util-5.11.9 share/rbbt_commands/tsv/unzip
rbbt-util-5.11.8 share/rbbt_commands/tsv/unzip
rbbt-util-5.11.7 share/rbbt_commands/tsv/unzip
rbbt-util-5.11.6 share/rbbt_commands/tsv/unzip
rbbt-util-5.11.5 share/rbbt_commands/tsv/unzip
rbbt-util-5.11.4 share/rbbt_commands/tsv/unzip
rbbt-util-5.11.3 share/rbbt_commands/tsv/unzip
rbbt-util-5.11.2 share/rbbt_commands/tsv/unzip
rbbt-util-5.11.1 share/rbbt_commands/tsv/unzip
rbbt-util-5.10.2 share/rbbt_commands/tsv/unzip
rbbt-util-5.10.1 share/rbbt_commands/tsv/unzip
rbbt-util-5.9.12 share/rbbt_commands/tsv/unzip
rbbt-util-5.9.11 share/rbbt_commands/tsv/unzip
rbbt-util-5.9.10 share/rbbt_commands/tsv/unzip
rbbt-util-5.9.8 share/rbbt_commands/tsv/unzip
rbbt-util-5.9.7 share/rbbt_commands/tsv/unzip
rbbt-util-5.9.6 share/rbbt_commands/tsv/unzip
rbbt-util-5.9.5 share/rbbt_commands/tsv/unzip