Last active
September 10, 2019 03:20
-
-
Save vmi/b8d135f0b252fbc8ee782a3ca49c073b to your computer and use it in GitHub Desktop.
Snippet of writing Excel CSV (ja) by Ruby.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'csv' | |
BOM = "\u{FEFF}" | |
CSV.open(filename, "w", encoding: Encoding::UTF_8) do |csv| | |
csv << [ BOM + header1, header2, ... ] | |
csv << [ cell1_1, cell1_2, ... ] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment