種類
- 特異メソッド (110)
- インスタンスメソッド (44)
- 文書 (42)
- クラス (11)
- 定数 (11)
ライブラリ
- csv (176)
クラス
- CSV (165)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - ConverterEncoding (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
external
_ encoding (11) - foreach (11)
- generate (11)
-
generate
_ line (11) - inspect (11)
-
internal
_ encoding (11) - new (11)
- open (44)
- read (11)
- readlines (11)
-
ruby 1
. 8 . 2 feature (11)
検索結果
先頭5件
-
CSV
# encoding -> Encoding (39238.0) -
読み書きするときに使用するエンコーディングを返します。
...読み書きするときに使用するエンコーディングを返します。
//emlist[例][ruby]{
require "csv"
csv = CSV.new("header1,header2\nrow1_1,row1_2", headers: true)
csv.encoding # => #<Encoding:UTF-8>
//}... -
CSV (38448.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")......010"]
# ファイルから一度に
p CSV.read("sample.csv")
# => [["Ruby", "1995"], ["Rust", "2010"]]
# 文字列から一行ずつ
CSV.parse(csv_text) do |row|
p row
end
# => ["Ruby", "1995"]
# ["Rust", "2010"]
# 文字列から一度に
p CSV.parse(csv_text)
# => [["Ruby", "1995"], ["Rust......dout
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... -
CSV
# internal _ encoding -> Encoding | nil (27224.0) -
IO#internal_encoding に委譲します。
...IO#internal_encoding に委譲します。
@see IO#internal_encoding... -
CSV
# external _ encoding -> Encoding | nil (27218.0) -
IO#external_encoding に委譲します。
...IO#external_encoding に委譲します。... -
CSV
:: ConverterEncoding -> Encoding (27201.0) -
すべての変換器で使用するエンコーディングです。
すべての変換器で使用するエンコーディングです。 -
CSV
. open(filename , mode = "rb" , options = Hash . new) -> CSV (21370.0) -
このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
...ンして CSV でラップします。
これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
このメソッドは IO.open と同じように動きます。ブロックが与えられた場合は
ブロックに CSV オブジ......た場合は CSV オブジェクトを返します。
データが Encoding.default_external と異なる場合は、mode にエンコー
ディングを指定する文字列を埋め込まなければなりません。データをどのよう
に解析するか決定するために CSV ライブ......自動的に取り除きま
す。
CSV オブジェクトは多くのメソッドを IO や File に委譲します。
* IO#binmode
* IO#binmode?
* IO#close
* IO#close_read
* IO#close_write
* IO#closed?
* IO#eof
* IO#eof?
* IO#external_encoding
* IO#fcntl
* IO#fileno
* File... -
CSV
. open(filename , mode = "rb" , options = Hash . new) {|csv| . . . } -> nil (21370.0) -
このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
...ンして CSV でラップします。
これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
このメソッドは IO.open と同じように動きます。ブロックが与えられた場合は
ブロックに CSV オブジ......た場合は CSV オブジェクトを返します。
データが Encoding.default_external と異なる場合は、mode にエンコー
ディングを指定する文字列を埋め込まなければなりません。データをどのよう
に解析するか決定するために CSV ライブ......自動的に取り除きま
す。
CSV オブジェクトは多くのメソッドを IO や File に委譲します。
* IO#binmode
* IO#binmode?
* IO#close
* IO#close_read
* IO#close_write
* IO#closed?
* IO#eof
* IO#eof?
* IO#external_encoding
* IO#fcntl
* IO#fileno
* File... -
CSV
. open(filename , options = Hash . new) -> CSV (21370.0) -
このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
...ンして CSV でラップします。
これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
このメソッドは IO.open と同じように動きます。ブロックが与えられた場合は
ブロックに CSV オブジ......た場合は CSV オブジェクトを返します。
データが Encoding.default_external と異なる場合は、mode にエンコー
ディングを指定する文字列を埋め込まなければなりません。データをどのよう
に解析するか決定するために CSV ライブ......自動的に取り除きま
す。
CSV オブジェクトは多くのメソッドを IO や File に委譲します。
* IO#binmode
* IO#binmode?
* IO#close
* IO#close_read
* IO#close_write
* IO#closed?
* IO#eof
* IO#eof?
* IO#external_encoding
* IO#fcntl
* IO#fileno
* File... -
CSV
. open(filename , options = Hash . new) {|csv| . . . } -> nil (21370.0) -
このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
...ンして CSV でラップします。
これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
このメソッドは IO.open と同じように動きます。ブロックが与えられた場合は
ブロックに CSV オブジ......た場合は CSV オブジェクトを返します。
データが Encoding.default_external と異なる場合は、mode にエンコー
ディングを指定する文字列を埋め込まなければなりません。データをどのよう
に解析するか決定するために CSV ライブ......自動的に取り除きま
す。
CSV オブジェクトは多くのメソッドを IO や File に委譲します。
* IO#binmode
* IO#binmode?
* IO#close
* IO#close_read
* IO#close_write
* IO#closed?
* IO#eof
* IO#eof?
* IO#external_encoding
* IO#fcntl
* IO#fileno
* File... -
CSV
. new(data , options = Hash . new) -> CSV (21339.0) -
このメソッドは CSV ファイルを読み込んだり、書き出したりするために String か IO のインスタンスをラップします。
...このメソッドは CSV ファイルを読み込んだり、書き出したりするために
String か IO のインスタンスをラップします。
ラップされた文字列の先頭から読み込むことになります。
文字列に追記したい場合は CSV.generate を使用し......ンスを指定します。
String のインスタンスを指定した場合、CSV#string を使用して
後からデータを取り出すことが出来ます。
@param options CSV をパースするためのオプションをハッシュで指定します。......an cause
problems with resetting the document position to where it was before the
read ahead. This String will be transcoded into the data's Encoding before parsing.
: :quote_char
フィールドをクオートする文字を指定します。長さ 1 の文字列でなければなりませ...