Created
November 28, 2013 02:04
-
-
Save ohnishiakira/7686225 to your computer and use it in GitHub Desktop.
This file contains 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/env ruby | |
# coding: utf-8 | |
require "csv" | |
rows = [ | |
[nil, "ほげ"], | |
["", "ほげ"] | |
] | |
puts CSV.generate("", force_quotes:true){|csv| | |
rows.map{|row| csv << row} | |
} | |
puts CSV.generate(""){|csv| | |
rows.map{|row| csv << row} | |
} | |
puts CSV.generate("", col_sep:"\t"){|csv| | |
rows.map{|row| csv << row} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment