Skip to content

Instantly share code, notes, and snippets.

@Lytol
Created March 25, 2014 18:21
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 Lytol/9767941 to your computer and use it in GitHub Desktop.
Save Lytol/9767941 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'csv'
abort("You must specify a CSV file") unless ARGV.length == 1
CSV do |out|
CSV.foreach(ARGV[0], encoding: 'ISO-8859-1') do |row|
out << row.map { |c| c.nil? ? nil : c.encode('UTF-8') }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment