Sha256: ea9b933e74798f655148745a4d01b76195ade163db3c39b473708a425de9ba02

Contents?: true

Size: 775 Bytes

Versions: 37

Compression:

Stored size: 775 Bytes

Contents

#!/usr/bin/env ruby

require 'rbbt-util'
require 'rbbt/util/simpleopt'

options = SOPT.get("-tch--tokyocabinet:-tcb--tokyocabinet_bd")

file = ARGV.shift

case
when options[:tokyocabinet]
  tsv = Persist.open_tokyocabinet(file, false)
  puts tsv.summary
when options[:tokyocabinet_bd]
  tsv = Persist.open_tokyocabinet(file, false, nil, TokyoCabinet::BDB)
  puts tsv.summary
else
  header = TSV.parse_header(Open.open(file))

  puts "File: #{ file }"
  puts "Key: #{header.key_field}"
  puts "Fields: "
  header.fields.each_with_index do |f,i|
    puts "  - #{i + 1}: " << f
  end
  puts "Rows: #{`wc -l #{ file }|cut -f 1 -d' '`}"
  puts "First line:"
  parts = []
  header.first_line.split(header.sep).each_with_index{|p,i| parts << "(#{i}) #{p}"}
  puts parts * "\t"
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
rbbt-util-5.6.1 share/rbbt_commands/tsv/info
rbbt-util-5.6.0 share/rbbt_commands/tsv/info
rbbt-util-5.5.68 share/rbbt_commands/tsv/info
rbbt-util-5.5.67 share/rbbt_commands/tsv/info
rbbt-util-5.5.66 share/rbbt_commands/tsv/info
rbbt-util-5.5.65 share/rbbt_commands/tsv/info
rbbt-util-5.5.64 share/rbbt_commands/tsv/info
rbbt-util-5.5.63 share/rbbt_commands/tsv/info
rbbt-util-5.5.62 share/rbbt_commands/tsv/info
rbbt-util-5.5.61 share/rbbt_commands/tsv/info
rbbt-util-5.5.60 share/rbbt_commands/tsv/info
rbbt-util-5.5.59 share/rbbt_commands/tsv/info
rbbt-util-5.5.58 share/rbbt_commands/tsv/info
rbbt-util-5.5.57 share/rbbt_commands/tsv/info
rbbt-util-5.5.56 share/rbbt_commands/tsv/info
rbbt-util-5.5.55 share/rbbt_commands/tsv/info
rbbt-util-5.5.54 share/rbbt_commands/tsv/info
rbbt-util-5.5.53 share/rbbt_commands/tsv/info
rbbt-util-5.5.52 share/rbbt_commands/tsv/info
rbbt-util-5.5.51 share/rbbt_commands/tsv/info