るりまサーチ

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. kernel $-i

クラス

キーワード

検索結果

<< 1 2 3 ... > >>

CSV#internal_encoding -> Encoding | nil (18503.0)

IO#internal_encoding に委譲します。

...
I
O#internal_encoding に委譲します。


@see IO#internal_encoding...

CSV#external_encoding -> Encoding | nil (12403.0)

IO#external_encoding に委譲します。

...
I
O#external_encoding に委譲します。...

CSV.generate_line(row, options = Hash.new) -> String (12308.0)

このメソッドは一つの Array オブジェクトを CSV 文字列に変換するためのショートカットです。 複数行のCSVを扱う際はCSV#<<を使うとより高速です。

...ドは一つの Array オブジェクトを CSV 文字列に変換するためのショートカットです。
複数行のCSVを扱う際はCSV#<<を使うとより高速です。

このメソッドは可能であれば row に含まれる最初の nil でない値を用いて出力の
エンコ...
...ions CSV.new のオプションと同じオプションを指定できます。
:encoding というキーを使用すると出力のエンコーディングを指定することができます。
:row_sep というキーの値には $/ がセットされます。

//eml...
...ist[例][ruby]{
require "csv"

taro = ['1', 'taro', 'tanaka', '20']
CSV
.generate_line(taro, col_sep: '|') # => "1|taro|tanaka|20\n"
//}

@see CSV.new...

CSV::FieldInfo#line -> Integer (12308.0)

行番号を返します。

...返します。

//emlist[例][ruby]{
require 'csv'

csv
= CSV.new("date1,date2,date3\n2018-07-09,2018-07-10\n2018-08-09,2018-08-10", headers: true)
csv
.convert do |field,field_info|
p field_info.line
Date.parse(field)
end
p csv.to_a

# => 2
# => 2
# => 3
# => 3
# => [#<CSV::Row "date1":#<Date:...
...2018-07-09 ((2458309j,0s,0n),+0s,2299161j)> "date2":#<Date: 2018-07-10 ((2458310j,0s,0n),+0s,2299161j)> "date3":nil>, ...]
//}...

CSV#close_write -> nil (12303.0)

IO#close_write に委譲します。

...
I
O#close_write に委譲します。


@see IO#close_write...

絞り込み条件を変える

CSV::DEFAULT_OPTIONS -> Hash (12232.0)

このオプションは呼び出し側で上書きしなかったときに使用するオプションです。

...るオプションです。

: :col_sep
","
: :row_sep
:auto
: :quote_char
'"'
: :field_size_limit
nil

: :converters
nil

: :unconverted_fields
nil

: :headers
false
: :return_headers
false
: :header_converters
nil

: :skip_blanks
false
: :force_quotes
false
: :skip_lines
nil
...

CSV#field_size_limit -> Integer (12208.0)

フィールドサイズの最大値を返します。

...

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

csv
= CSV.new(DATA)
csv
.field_size_limit # => nil
p csv.read # => [["a", "b"], ["\n2\n2\n", ""]]

DATA.rewind
csv
= CSV.new(DATA, field_size_limit: 4)
p csv.field_size_limit # => 4
csv
.read # => #<CSV::MalformedCSVError: Field size exceeded on line 2.>

__END...
...__
"a","b"
"
2
2
",""
//}

@see CSV.new...

CSV#unconverted_fields? -> bool (12208.0)

パースした結果が unconverted_fields というメソッドを持つ場合に真を返します。 そうでない場合は、偽を返します。

...た結果が unconverted_fields というメソッドを持つ場合に真を返します。
そうでない場合は、偽を返します。


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

csv
= CSV.new("date1,date2\n2018-07-09,2018-07-10")
csv
.unconverted_fields? # => nil
csv
= CSV.new("date1,date2\n2018-07...
...-09,2018-07-10", unconverted_fields: false)
csv
.unconverted_fields? # => false
csv
= CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true, unconverted_fields: true)
csv
.unconverted_fields? # => true
csv
.convert(:date)
row = csv.readline
row.fields # => [#<Date: 2018-07-09 ((24583...
...09j,0s,0n),+0s,2299161j)>, #<Date: 2018-07-10 ((2458310j,0s,0n),+0s,2299161j)>]
row.unconverted_fields # => ["2018-07-09", "2018-07-10"]
//}

@see CSV.new...

CSV::Row#fields(*headers_and_or_indices) -> Array (12208.0)

与えられた引数に対応する値の配列を返します。

...与えられた引数に対応する値の配列を返します。

要素の探索に CSV::Row.field を使用しています。

@param headers_and_or_indices ヘッダの名前かインデックスか Range
のインスタンスか第 1 要素がヘッダの名前...
...るこ
とができます。

@return 引数を与えなかった場合は全ての要素を返します。

require 'csv'
csv
= CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
row = table.first
row.values_at("a", 1, 2..3) # => ["1", "2", "3", nil]...

CSV::Row#values_at(*headers_and_or_indices) -> Array (9208.0)

与えられた引数に対応する値の配列を返します。

...与えられた引数に対応する値の配列を返します。

要素の探索に CSV::Row.field を使用しています。

@param headers_and_or_indices ヘッダの名前かインデックスか Range
のインスタンスか第 1 要素がヘッダの名前...
...るこ
とができます。

@return 引数を与えなかった場合は全ての要素を返します。

require 'csv'
csv
= CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
row = table.first
row.values_at("a", 1, 2..3) # => ["1", "2", "3", nil]...

絞り込み条件を変える

<< 1 2 3 ... > >>