1056件ヒット
[1-100件を表示]
(0.095秒)
種類
- インスタンスメソッド (825)
- 特異メソッド (187)
- 定数 (44)
クラス
- Array (11)
- CSV (682)
-
CSV
:: FieldInfo (33) -
CSV
:: Row (187) -
CSV
:: Table (132) - String (11)
キーワード
- ConverterEncoding (11)
-
DEFAULT
_ OPTIONS (11) - DateTimeMatcher (11)
- VERSION (11)
- [] (44)
- binmode (11)
- binmode? (11)
- close (11)
-
close
_ read (11) -
close
_ write (11) -
col
_ sep (11) - convert (22)
- delete (22)
-
delete
_ if (33) - each (22)
- encoding (11)
-
external
_ encoding (11) - fcntl (11)
- field (11)
- field? (11)
-
field
_ row? (11) -
field
_ size _ limit (11) - fields (11)
- fileno (11)
- flock (11)
- foreach (11)
- fsync (11)
- generate (11)
-
generate
_ line (11) - header (11)
- headers (11)
- include? (11)
- index (22)
- inspect (33)
- instance (22)
-
internal
_ encoding (11) - ioctl (11)
- isatty (11)
- length (22)
- line (11)
- lineno (11)
- new (22)
- open (44)
- parse (22)
-
parse
_ csv (11) -
parse
_ line (11) - path (11)
- pid (11)
- pos (11)
-
quote
_ char (11) - read (11)
- readline (11)
- readlines (22)
- reopen (11)
- rewind (11)
-
row
_ sep (11) - seek (11)
- shift (11)
- size (22)
-
skip
_ blanks? (11) - stat (11)
- string (11)
- table (11)
- tell (11)
-
to
_ csv (33) -
to
_ i (11) -
to
_ io (11) -
to
_ s (22) - tty? (11)
-
unconverted
_ fields? (11) -
values
_ at (22) -
write
_ headers? (11)
検索結果
先頭5件
-
CSV
# internal _ encoding -> Encoding | nil (12402.0) -
IO#internal_encoding に委譲します。
...
IO#internal_encoding に委譲します。
@see IO#internal_encoding... -
CSV
:: Row # index(header , minimum _ index = 0) -> Integer (6502.0) -
与えられたヘッダの名前に対応するインデックスを返します。
...@param minimum_index このインデックスより後で、ヘッダの名前を探します。
重複しているヘッダがある場合に便利です。
//emlist[例][ruby]{
require "csv"
row = CSV::Row.new(["header1", "header2", "header1"], [1, 2, 3])
row.index("header......1") # => 0
row.index("header1", 1) # => 2
//}
@see CSV::Row#field... -
CSV
:: FieldInfo # line -> Integer (6374.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 ((24......58309j,0s,0n),+0s,2299161j)> "date2":#<Date: 2018-07-10 ((2458310j,0s,0n),+0s,2299161j)> "date3":nil>, ...]
//}... -
CSV
:: FieldInfo # index -> Integer (6350.0) -
行内で何番目のフィールドかわかるゼロベースのインデックスを返します。
...スを返します。
//emlist[例][ruby]{
require 'csv'
csv = CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert do |field,field_info|
p field_info.index
Date.parse(field)
end
p csv.first
# => 0
# => 1
# => #<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j,0s,0n),+0s,229......9161j)> "date2":#<Date: 2018-07-10 ((2458310j,0s,0n),+0s,2299161j)>>
//}... -
CSV
# unconverted _ fields? -> bool (6322.0) -
パースした結果が unconverted_fields というメソッドを持つ場合に真を返します。 そうでない場合は、偽を返します。
...erted_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", un......converted_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 ((2458309j,0s,0n),+0s,2299......161j)>, #<Date: 2018-07-10 ((2458310j,0s,0n),+0s,2299161j)>]
row.unconverted_fields # => ["2018-07-09", "2018-07-10"]
//}
@see CSV.new... -
CSV
:: Table # inspect -> String (6318.0) -
モードとサイズを US-ASCII な文字列で返します。
...モードとサイズを US-ASCII な文字列で返します。
//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.inspect # => "#<CSV::Table mode:col_or_row row_count:2>"
//}... -
CSV
# encoding -> Encoding (6308.0) -
読み書きするときに使用するエンコーディングを返します。
...読み書きするときに使用するエンコーディングを返します。
//emlist[例][ruby]{
require "csv"
csv = CSV.new("header1,header2\nrow1_1,row1_2", headers: true)
csv.encoding # => #<Encoding:UTF-8>
//}... -
CSV
# inspect -> String (6308.0) -
ASCII 互換文字列で自身の情報を表したものを返します。
...ASCII 互換文字列で自身の情報を表したものを返します。
//emlist[例][ruby]{
require "csv"
csv = CSV.new("header1,header2\nrow1_1,row1_2")
csv.inspect # => "<#CSV io_type:StringIO encoding:UTF-8 lineno:0 col_sep:\",\" row_sep:\"\\n\" quote_char:\"\\\"\">"
//}... -
CSV
# external _ encoding -> Encoding | nil (6302.0) -
IO#external_encoding に委譲します。
...
IO#external_encoding に委譲します。... -
CSV
# lineno -> Integer (6302.0) -
このファイルから読み込んだ最終行の行番号を返します。 フィールドに含まれる改行はこの値には影響しません。
...このファイルから読み込んだ最終行の行番号を返します。
フィールドに含まれる改行はこの値には影響しません。
//emlist[例][ruby]{
require "csv"
csv = CSV.new("header1,header2\nrow1_1,row1_2")
csv.lineno # => 0
csv.readline
csv.lineno # => 1
//}...