Skip to content

Instantly share code, notes, and snippets.

@darui00kara
Created May 12, 2015 14:25
Show Gist options
  • Save darui00kara/0c4cab8da7172d015175 to your computer and use it in GitHub Desktop.
Save darui00kara/0c4cab8da7172d015175 to your computer and use it in GitHub Desktop.
# encoding: utf-8
# File Name: csv-read.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ファイルを読み込んで表示
arr_of_arrs = CSV.read("test-data.csv")
arr_of_arrs.each do |row|
print row, "\n"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment