別のキーワード
クラス
- Array (1)
- CSV (35)
-
CSV
:: Table (2) - String (1)
キーワード
- binmode (1)
- binmode? (1)
- close (1)
-
close
_ read (1) -
close
_ write (1) - closed? (1)
- eof (1)
- eof? (1)
-
external
_ encoding (1) - fcntl (1)
- fileno (1)
- flock (1)
- flush (1)
- fsync (1)
- gets (1)
- inspect (1)
-
internal
_ encoding (1) - ioctl (1)
- isatty (1)
-
parse
_ csv (1) - path (1)
- pid (1)
- pos (1)
- pos= (1)
- readline (1)
- reopen (1)
- rewind (1)
- seek (1)
- shift (1)
- stat (1)
- sync (1)
- sync= (1)
- tell (1)
-
to
_ csv (2) -
to
_ i (1) -
to
_ io (1) -
to
_ s (1) - tty? (1)
検索結果
先頭5件
-
CSV
# to _ io -> self (81445.0) -
IO#to_io に委譲します。
IO#to_io に委譲します。
@see IO#to_io -
CSV
# ioctl(cmd , arg = 0) -> Integer (81376.0) -
IO#ioctl に委譲します。
IO#ioctl に委譲します。
@see IO#ioctl -
CSV
# gets -> Array | CSV :: Row (63523.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
# readline -> Array | CSV :: Row (63523.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
# shift -> Array | CSV :: Row (63523.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
# reopen(io) -> self (63379.0) -
IO#reopen に委譲します。
IO#reopen に委譲します。
@see IO#reopen -
CSV
# seek(offset , whence = IO :: SEEK _ SET) -> 0 (63379.0) -
IO#seek に委譲します。
IO#seek に委譲します。
@see IO#seek -
CSV
# flock(operation) -> 0 | false (63310.0) -
File#flock に委譲します。
File#flock に委譲します。 -
CSV
# rewind -> 0 (63268.0) -
IO#rewind に似ています。CSV#lineno を 0 にします。
...IO#rewind に似ています。CSV#lineno を 0 にします。
//emlist[例][ruby]{
require "csv"
csv = CSV.new("header1,header2\nrow1_1,row1_2")
csv.lineno # => 0
csv.readline
csv.lineno # => 1
csv.rewind
csv.lineno # => 0
//}
@see IO#rewind... -
CSV
# eof -> bool (63142.0) -
IO#eof, IO#eof? に委譲します。
IO#eof, IO#eof? に委譲します。
@see IO#eof, IO#eof? -
CSV
# eof? -> bool (63142.0) -
IO#eof, IO#eof? に委譲します。
IO#eof, IO#eof? に委譲します。
@see IO#eof, IO#eof? -
CSV
# isatty -> bool (63142.0) -
IO#isatty, IO#tty? に委譲します。
IO#isatty, IO#tty? に委譲します。
@see IO#isatty, IO#tty? -
CSV
# pos -> Integer (63142.0) -
IO#pos, IO#tell に委譲します。
IO#pos, IO#tell に委譲します。
@see IO#pos, IO#tell -
CSV
# tell -> Integer (63142.0) -
IO#pos, IO#tell に委譲します。
IO#pos, IO#tell に委譲します。
@see IO#pos, IO#tell -
CSV
# tty? -> bool (63142.0) -
IO#isatty, IO#tty? に委譲します。
IO#isatty, IO#tty? に委譲します。
@see IO#isatty, IO#tty? -
CSV
# inspect -> String (63118.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 (63106.0) -
IO#fileno, IO#to_i に委譲します。
IO#fileno, IO#to_i に委譲します。 -
CSV
# to _ i -> Integer (63106.0) -
IO#fileno, IO#to_i に委譲します。
IO#fileno, IO#to_i に委譲します。 -
CSV
# binmode -> self (63076.0) -
IO#binmode に委譲します。
IO#binmode に委譲します。
@see IO#binmode -
CSV
# binmode? -> bool (63076.0) -
IO#binmode? に委譲します。
IO#binmode? に委譲します。
@see IO#binmode? -
CSV
# close -> nil (63076.0) -
IO#close に委譲します。
IO#close に委譲します。
@see IO#close -
CSV
# close _ read -> nil (63076.0) -
IO#close_read に委譲します。
IO#close_read に委譲します。
@see IO#close_read -
CSV
# close _ write -> nil (63076.0) -
IO#close_write に委譲します。
IO#close_write に委譲します。
@see IO#close_write -
CSV
# closed? -> bool (63076.0) -
IO#closed? に委譲します。
IO#closed? に委譲します。
@see IO#closed? -
CSV
# internal _ encoding -> Encoding | nil (63076.0) -
IO#internal_encoding に委譲します。
IO#internal_encoding に委譲します。
@see IO#internal_encoding -
CSV
# path -> String (63076.0) -
IO#path に委譲します。
IO#path に委譲します。
@see IO#path -
CSV
# pid -> Integer | nil (63076.0) -
IO#pid に委譲します。
IO#pid に委譲します。
@see IO#pid -
CSV
# pos=(n) (63076.0) -
IO#pos= に委譲します。
IO#pos= に委譲します。
@see IO#pos= -
CSV
# stat -> File :: Stat (63076.0) -
IO#stat に委譲します。
IO#stat に委譲します。
@see IO#stat -
CSV
# sync -> bool (63076.0) -
IO#sync に委譲します。
IO#sync に委譲します。
@see IO#sync -
CSV
# sync=(newstate) (63076.0) -
IO#sync= に委譲します。
IO#sync= に委譲します。
@see IO#sync= -
CSV
# external _ encoding -> Encoding | nil (63058.0) -
IO#external_encoding に委譲します。
IO#external_encoding に委譲します。 -
CSV
# fcntl(cmd , arg = 0) -> Integer (63058.0) -
IO#fcntl に委譲します。
IO#fcntl に委譲します。 -
CSV
# flush -> self (63058.0) -
IO#flush に委譲します。
IO#flush に委譲します。 -
CSV
# fsync -> 0 | nil (63058.0) -
IO#fsync に委譲します。
IO#fsync に委譲します。 -
CSV
:: Table # to _ csv(options = Hash . new) -> String (27769.0) -
CSV の文字列に変換して返します。
...
CSV の文字列に変換して返します。
ヘッダを一行目に出力します。その後に残りのデータを出力します。
デフォルトでは、ヘッダを出力します。オプションに :write_headers =>
false を指定するとヘッダを出力しません。
//emli......st[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.to_csv # => "a,b,c\n1,2,3\n"
p table.to_csv(write_headers: false) # => "1,2,3\n"
//}... -
String
# parse _ csv(**options) -> [String] (18859.0) -
CSV.parse_line(self, options) と同様です。
...
CSV.parse_line(self, options) と同様です。
1 行の CSV 文字列を、文字列の配列に変換するためのショートカットです。
@param options CSV.new と同様のオプションを指定します。
//emlist[][ruby]{
require "csv"
p "Matz,Ruby\n".parse_csv......by\r\n".parse_csv(col_sep: '|', row_sep: "\r\n") # => ["Matz", "Ruby"]
//}
Ruby 2.6 (CSV 3.0.2) から、次のオプションが使えるようになりました。
//emlist[][ruby]{
require 'csv'
p "1,,3\n".parse_csv # => ["1", nil, "3"]
p "1,,3\n".parse_csv(nil_value: F......loat::NAN) # => ["1", NaN, "3"]
//}
@see CSV.new, CSV.parse_line... -
Array
# to _ csv(**options) -> String (18769.0) -
CSV.generate_line(self, options) と同様です。
...
CSV.generate_line(self, options) と同様です。
Array オブジェクトを 1 行の CSV 文字列に変換するためのショートカットです。
@param options CSV.generate_line と同様のオプションを指定します。
//emlist[][ruby]{
require 'csv'
p [1, 'Matz', :Ruby, Dat......e.new(1965, 4, 14)].to_csv # => "1,Matz,Ruby,1965-04-14\n"
p [1, 'Matz', :Ruby, Date.new(1965, 4, 14)].to_csv(col_sep: ' ', row_sep: "\r\n") # => "1 Matz Ruby 1965-04-14\r\n"
//}
@see CSV.generate_line... -
CSV
:: Table # to _ s(options = Hash . new) -> String (18469.0) -
CSV の文字列に変換して返します。
...
CSV の文字列に変換して返します。
ヘッダを一行目に出力します。その後に残りのデータを出力します。
デフォルトでは、ヘッダを出力します。オプションに :write_headers =>
false を指定するとヘッダを出力しません。
//emli......st[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.to_csv # => "a,b,c\n1,2,3\n"
p table.to_csv(write_headers: false) # => "1,2,3\n"
//}...