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