るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.040秒)
トップページ > クエリ:IO[x] > クエリ:io[x] > クエリ:all[x] > ライブラリ:csv[x]

別のキーワード

  1. io popen
  2. io pipe
  3. io each
  4. io each_line
  5. io readlines

検索結果

CSV (62.0)

このクラスは CSV ファイルやデータに対する完全なインターフェイスを提供します。

... CSV ファイルやデータに対する完全なインターフェイスを提供します。

=== 読み込み

//emlist[][ruby]{
require "csv"

csv
_text = <<~CSV_TEXT
Ruby,1995
Rust,2010
CSV
_TEXT

IO
.write "sample.csv", csv_text

# ファイルから一行ずつ
CSV
.foreach("sample.csv")...
...'csv'

CSV
{ |csv_out| csv_out << %w{my data here} } # to $stdout
CSV
(csv = "") { |csv_str| csv_str << %w{my data here} } # to a String
CSV
($stderr) { |csv_err| csv_err << %w{my data here} } # to $stderr
//}

=== CSV と文字エンコーディング (M17n or Multilingualization...
...)

This new CSV parser is m17n savvy. The parser works in the Encoding of the IO
or String object being read from or written to. Your data is never transcoded
(unless you ask Ruby to transcode it for you) and will literally be parsed in
the Encoding it is in. Thus CSV will return Arrays or Rows o...