Sha256: 0418c1489ee5cbedcbcddf3d5e7df155f50ec1c131901fac39f60b3623bdcbf3

Contents?: true

Size: 1.32 KB

Versions: 21

Compression:

Stored size: 1.32 KB

Contents

#!/usr/bin/env ruby

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

$0 = "rbbt #{$previous_commands*""} #{ File.basename(__FILE__) }" if $previous_commands

options = SOPT.setup <<EOF

Description

$ rbbt tsv write_excel [options] <filename.tsv|-> <filename.xls|filename.xlsx>

Use - to read from STDIN

-k--key_field* Key field
-f--fields* Fields
-t--type* Type
-m--merge Merge from multiple rows
-um--unmerge Write the results unmerged
-W--workflows* Load a list of workflows
-R--requires* Require a list of files
-n--name Transform entities to human readible names
-h--help Print this help

EOF
if options[:help]
  if defined? rbbt_usage
    rbbt_usage 
  else
    puts SOPT.doc
  end
  exit 0
end

if options[:workflows]
  require 'rbbt/workflow'
  workflows = options[:workflows].split(',')
  workflows.each do |workflow|
    workflow.strip!
    Workflow.require_workflow workflow
  end
end

if options[:requires]
  requires = options[:requires].split(',')
  requires.each do |req|
    req.strip!
    require req
  end
end

tsvfile, excelfile = ARGV

excelfile, tsvfile = tsvfile, nil if excelfile.nil? and tsvfile =~ /\.(xls|xlsx)$/

raise ParameterException, "No TSV file given" if tsvfile.nil?

excelfile = tsvfile.sub(/\.tsv(\.gz)?$/, '.xlsx') if excelfile.nil?

require 'rbbt/tsv/excel'
TSV.open(tsvfile, options).excel(excelfile, options)

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rbbt-util-5.40.4 share/rbbt_commands/tsv/write_excel
rbbt-util-5.40.3 share/rbbt_commands/tsv/write_excel
rbbt-util-5.40.0 share/rbbt_commands/tsv/write_excel
rbbt-util-5.39.0 share/rbbt_commands/tsv/write_excel
rbbt-util-5.38.1 share/rbbt_commands/tsv/write_excel
rbbt-util-5.38.0 share/rbbt_commands/tsv/write_excel
rbbt-util-5.37.16 share/rbbt_commands/tsv/write_excel
rbbt-util-5.37.15 share/rbbt_commands/tsv/write_excel
rbbt-util-5.37.14 share/rbbt_commands/tsv/write_excel
rbbt-util-5.37.13 share/rbbt_commands/tsv/write_excel
rbbt-util-5.37.12 share/rbbt_commands/tsv/write_excel
rbbt-util-5.37.11 share/rbbt_commands/tsv/write_excel
rbbt-util-5.37.10 share/rbbt_commands/tsv/write_excel
rbbt-util-5.37.9 share/rbbt_commands/tsv/write_excel
rbbt-util-5.37.8 share/rbbt_commands/tsv/write_excel
rbbt-util-5.37.6 share/rbbt_commands/tsv/write_excel
rbbt-util-5.37.4 share/rbbt_commands/tsv/write_excel
rbbt-util-5.37.3 share/rbbt_commands/tsv/write_excel
rbbt-util-5.37.1 share/rbbt_commands/tsv/write_excel
rbbt-util-5.37.0 share/rbbt_commands/tsv/write_excel