ライブラリ
- csv (20)
キーワード
-
col
_ sep (1) - encoding (1)
-
external
_ encoding (1) - fcntl (1)
-
field
_ size _ limit (1) - fileno (1)
- inspect (1)
-
internal
_ encoding (1) - ioctl (1)
- lineno (1)
- path (1)
- pid (1)
- pos (1)
-
quote
_ char (1) - readline (1)
-
row
_ sep (1) - string (1)
- tell (1)
-
to
_ i (1) - truncate (1)
検索結果
先頭5件
-
CSV
# encoding -> Encoding (37207.0) -
読み書きするときに使用するエンコーディングを返します。
...読み書きするときに使用するエンコーディングを返します。
//emlist[例][ruby]{
require "csv"
csv = CSV.new("header1,header2\nrow1_1,row1_2", headers: true)
csv.encoding # => #<Encoding:UTF-8>
//}... -
CSV
# string -> String (37207.0) -
StringIO#string に委譲します。
StringIO#string に委譲します。
@see StringIO#string -
CSV
# external _ encoding -> Encoding | nil (36907.0) -
IO#external_encoding に委譲します。
IO#external_encoding に委譲します。 -
CSV
# internal _ encoding -> Encoding | nil (36907.0) -
IO#internal_encoding に委譲します。
IO#internal_encoding に委譲します。
@see IO#internal_encoding -
CSV
# fcntl(cmd , arg = 0) -> Integer (18907.0) -
IO#fcntl に委譲します。
IO#fcntl に委譲します。 -
CSV
# inspect -> String (18625.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
# fileno -> Integer (18607.0) -
IO#fileno, IO#to_i に委譲します。
IO#fileno, IO#to_i に委譲します。 -
CSV
# lineno -> Integer (18607.0) -
このファイルから読み込んだ最終行の行番号を返します。 フィールドに含まれる改行はこの値には影響しません。
...このファイルから読み込んだ最終行の行番号を返します。
フィールドに含まれる改行はこの値には影響しません。
//emlist[例][ruby]{
require "csv"
csv = CSV.new("header1,header2\nrow1_1,row1_2")
csv.lineno # => 0
csv.readline
csv.lineno # => 1
//}... -
CSV
# truncate(path , length) -> 0 (18607.0) -
File#truncate に委譲します。
File#truncate に委譲します。
@see File#truncate -
CSV
# readline -> Array | CSV :: Row (18307.0) -
String や IO をラップしたデータソースから一行だけ読み込んで フィールドの配列か CSV::Row のインスタンスを返します。
...ールドの配列か CSV::Row のインスタンスを返します。
データソースは読み込み用にオープンされている必要があります。
@return ヘッダを使用しない場合は配列を返します。
ヘッダを使用する場合は CSV::Row を返します......。
//emlist[例][ruby]{
require "csv"
csv = CSV.new(DATA.read)
csv.readline # => ["header1", "header2"]
csv.readline # => ["row1_1", "row1_2"]
__END__
header1,header2
row1_1,row1_2
//}... -
CSV
# to _ i -> Integer (9607.0) -
IO#fileno, IO#to_i に委譲します。
IO#fileno, IO#to_i に委譲します。 -
CSV
# field _ size _ limit -> Integer (661.0) -
フィールドサイズの最大値を返します。
...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... -
CSV
# col _ sep -> String (607.0) -
カラム区切り文字列として使用する文字列を返します。
..."csv"
users =<<-EOS
id|first name|last name|age
1|taro|tanaka|20
2|jiro|suzuki|18
3|ami|sato|19
4|yumi|adachi|21
EOS
csv = CSV.new(users, headers: true, col_sep: "|")
csv.col_sep # => "|"
csv.first.to_a # => [["id", "1"], ["first name", "taro"], ["last name", "tanaka"], ["age", "20"]]
csv = CSV.......new(users, headers: true)
csv.col_sep # => ","
csv.first.to_a # => [["id|first name|last name|age", "1|taro|tanaka|20"]]
//}
@see CSV.new... -
CSV
# ioctl(cmd , arg = 0) -> Integer (607.0) -
IO#ioctl に委譲します。
IO#ioctl に委譲します。
@see IO#ioctl -
CSV
# path -> String (607.0) -
IO#path に委譲します。
IO#path に委譲します。
@see IO#path -
CSV
# pid -> Integer | nil (607.0) -
IO#pid に委譲します。
IO#pid に委譲します。
@see IO#pid -
CSV
# pos -> Integer (607.0) -
IO#pos, IO#tell に委譲します。
IO#pos, IO#tell に委譲します。
@see IO#pos, IO#tell -
CSV
# quote _ char -> String (607.0) -
フィールドをクオートするのに使用する文字列を返します。
...フィールドをクオートするのに使用する文字列を返します。
//emlist[例][ruby]{
require "csv"
csv = CSV.new("header1,header2\nrow1_1,row1_2", quote_char: "'")
csv.quote_char # => "'"
//}
@see CSV.new... -
CSV
# row _ sep -> String (607.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
# tell -> Integer (607.0) -
IO#pos, IO#tell に委譲します。
IO#pos, IO#tell に委譲します。
@see IO#pos, IO#tell