0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

RubyでtabのCSVファイルを読み込む

Posted at
  • hoge.csv
user\tpassword
foo\t1234
bar\t1111
# !/usr/bin/env ruby

require "csv"
require 'pp'

c = CSV.table('./hoge.csv',:col_sep => "\t")

c.each do |_c|
  p _c[:user]
  # "foo"
  # "bar"
end
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?