Skip to content

Instantly share code, notes, and snippets.

@suryart
Forked from rorcraft/batch convert xls to csv
Created January 19, 2012 11:27
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 suryart/1639501 to your computer and use it in GitHub Desktop.
Save suryart/1639501 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