Skip to content

Instantly share code, notes, and snippets.

@henri
Forked from dentarg/csv-dance.rb
Created July 16, 2025 02:05
Show Gist options
  • Save henri/05a1391a6fdb288f618369efbeee8fe8 to your computer and use it in GitHub Desktop.
Save henri/05a1391a6fdb288f618369efbeee8fe8 to your computer and use it in GitHub Desktop.
require 'csv'
require 'open-uri'
file = "Workbook3.csv"
content = CSV.read(open(file), encoding: 'ISO-8859-1:UTF-8', col_sep: ";")
File.open("output.csv", "w") do |f|
rows = content.map { |row| "\"#{row.join('","')}\"" }.join("\n")
f.puts(rows)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment