Skip to content

Instantly share code, notes, and snippets.

@amonks
Forked from rorcraft/batch convert xls to csv
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amonks/9631436 to your computer and use it in GitHub Desktop.
Save amonks/9631436 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'roo'
pwd = File.dirname(__FILE__)
Dir.glob("#{pwd}/*.xls") do |file|
file_path = "#{pwd}/#{file}"
file_basename = File.basename(file, ".xls")
xls = Roo::Excel.new(file_path)
xls.to_csv("#{pwd}/#{file_basename}.csv")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment