るりまサーチ

最速Rubyリファレンスマニュアル検索!
1026件ヒット [1-100件を表示] (0.011秒)

別のキーワード

  1. matrix row
  2. csv header_row?
  3. row []=
  4. csv row
  5. csv add_row

クラス

キーワード

検索結果

<< 1 2 3 ... > >>

CSV::Row#row -> Array (21104.0)

同値性を比較するために使用する内部的なデータです。

同値性を比較するために使用する内部的なデータです。

CSV::Row#field_row? -> bool (9152.0)

フィールド行であれば真を返します。そうでなければ偽を返します。

...ド行であれば真を返します。そうでなければ偽を返します。

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

header_row = CSV::Row.new(["header1", "header2"], [], true)
row
= CSV::Row.new(["header1", "header2"], [1, 2])
header_row.field_row? # => false
row
.field_row? # => true
//}...

CSV::Row#header_row? -> bool (9152.0)

ヘッダ行であれば真を返します。そうでなければ偽を返します。

...行であれば真を返します。そうでなければ偽を返します。

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

header_row = CSV::Row.new(["header1", "header2"], [], true)
row
= CSV::Row.new(["header1", "header2"], [1, 2])
header_row.header_row? # => true
row
.header_row? # => false
//}...

CSV::Table#by_row -> CSV::Table (6248.0)

ロウモードになっている新しい CSV::Table オブジェクトを返します。

...ロウモードになっている新しい CSV::Table オブジェクトを返します。

元のテーブルモードを変更せずにメソッドチェーンできるので便利です。しか
し、大きなデータセットに対しても同じだけメモリを消費するので気をつ...
...re "csv"

row
1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row
2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1, row2])
table # => #<CSV::Table mode:col_or_row row_count:3>
row
_table = table.by_row # => #<CSV::Table mode:row row_cou...
...nt:3>
row
_table[0] # => #<CSV::Row "header1":"row1_1" "header2":"row1_2">
row
_table[1] # => #<CSV::Row "header1":"row2_1" "header2":"row2_2">
//}...

CSV::Table#by_row! -> self (6230.0)

自身をロウモードに変更します。

...e "csv"

row
1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row
2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1, row2])
table # => #<CSV::Table mode:col_or_row row_count:3>
table.by_row!
table # => #<CSV::Table mode:row row_co...
...unt:3>
table[0] # => #<CSV::Row "header1":"row1_1" "header2":"row1_2">
table[1] # => #<CSV::Row "header1":"row2_1" "header2":"row2_2">
//}...

絞り込み条件を変える

CSV::Table#by_col_or_row -> CSV::Table (6206.0)

ミックスモードになっている新しい CSV::Table オブジェクトを返します。

...ミックスモードになっている新しい CSV::Table オブジェクトを返します。

元のテーブルモードを変更せずにメソッドチェーンできるので便利です。しか
し、大きなデータセットに対しても同じだけメモリを消費するので気...
...ire "csv"

row
1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row
2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1, row2]).by_col!
table # => #<CSV::Table mode:col row_count:3>
col_or_row_table = table.by_col_or_row
col_or_row_tabl...
...e # => #<CSV::Table mode:col_or_row row_count:3>
table # => #<CSV::Table mode:col row_count:3>
//}...

CSV::Table#by_col_or_row! -> self (6188.0)

自身をミックスモードに変更します。

...ire "csv"

row
1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row
2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1, row2]).by_col!
table # => #<CSV::Table mode:col row_count:3>
table.by_col_or_row!
table # => #<CSV::Tab...
...le mode:col_or_row row_count:3>
//}...

CSV#row_sep -> String (6140.0)

行区切り文字列として使用する文字列を返します。

...行区切り文字列として使用する文字列を返します。

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

csv
= CSV.new("header1,header2|row1_1,row1_2", row_sep: "|")
csv
.row_sep # => "|"
csv
.read # => [["header1", "header2"], ["row1_1", "row1_2"]]
//}

@see CSV.new...

CSV#header_row? -> bool (6122.0)

次に読み込まれる行が、ヘッダである場合に真を返します。 そうでない場合は、偽を返します。

...に読み込まれる行が、ヘッダである場合に真を返します。
そうでない場合は、偽を返します。

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

csv
= CSV.new("header1,header2\nrow1_1,row1_2", headers: true)
csv
.header_row? # => true
csv
.readline
csv
.header_row? # => false
//}...
<< 1 2 3 ... > >>