Skip to content

Instantly share code, notes, and snippets.

@darui00kara
Created May 12, 2015 14:26
Show Gist options
  • Save darui00kara/091b2f3617b8ee0850ca to your computer and use it in GitHub Desktop.
Save darui00kara/091b2f3617b8ee0850ca to your computer and use it in GitHub Desktop.
# encoding: utf-8
# File Name: csv-write.rb
# Create Day is 2015/05/12
# Last Update Day is 2015/05/12
# Gem List
# Require List
require 'csv'
# 外部エンコーディングを変更
Encoding.default_external = "UTF-8"
p Encoding.default_external
# csvファイルへ追記
CSV.open("test-data.csv", "a") do |csv|
csv << ["add1-title", "add1-name", "add1-text", "2015/5/12", "19:44:00"]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment