Skip to content

Instantly share code, notes, and snippets.

@herry13
Forked from rorcraft/batch convert xls to csv
Created November 24, 2013 20:41
Show Gist options
  • Save herry13/7632145 to your computer and use it in GitHub Desktop.
Save herry13/7632145 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 = 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