Sha256: fcb79af1f0276e8bb2bd3ac3dadd85c3cf35fa4b7e9ae7ffbb201844732469b5

Contents?: true

Size: 387 Bytes

Versions: 2

Compression:

Stored size: 387 Bytes

Contents

#! /usr/bin/env ruby

require 'csv'
require 'roo'
require 'roo-xls'

path, sheet = ARGV.first.to_s.split(':')

unless path && path.size > 0 && File.exists?(path)
  puts "Not found file"
  puts "Usage: tocsv /path/to/your/file.xlsx > data.csv"
  exit
end

xlsx = Roo::Spreadsheet.open(path)
str = CSV.generate do |csv|
  xlsx.sheet(sheet.to_i).to_a.each { |row| csv << row }
end
puts str

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tocsv-0.1.2 exe/tocsv
tocsv-0.1.1 exe/tocsv