るりまサーチ (Ruby 2.2.0)

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

別のキーワード

  1. io popen
  2. io pipe
  3. io each
  4. io each_line
  5. io readlines

クラス

キーワード

検索結果

CSV#to_io -> self (18445.0)

IO#to_io に委譲します。

IO#to_io に委譲します。


@see IO#to_io

CSV#ioctl(cmd, arg = 0) -> Integer (18376.0)

IO#ioctl に委譲します。

IO#ioctl に委譲します。


@see IO#ioctl

CSV#reopen(io) -> self (379.0)

IO#reopen に委譲します。

IO#reopen に委譲します。


@see IO#reopen

CSV#seek(offset, whence = IO::SEEK_SET) -> 0 (379.0)

IO#seek に委譲します。

IO#seek に委譲します。


@see IO#seek

Array#to_csv(**options) -> String (310.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#flock(operation) -> 0 | false (310.0)

File#flock に委譲します。

File#flock に委譲します。

CSV::Table#to_csv(options = Hash.new) -> String (310.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"
//}...

CSV::Table#to_s(options = Hash.new) -> String (310.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] (310.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...

CSV#eof -> bool (142.0)

IO#eof, IO#eof? に委譲します。

IO#eof, IO#eof? に委譲します。


@see IO#eof, IO#eof?

絞り込み条件を変える

CSV#eof? -> bool (142.0)

IO#eof, IO#eof? に委譲します。

IO#eof, IO#eof? に委譲します。


@see IO#eof, IO#eof?

CSV#isatty -> bool (142.0)

IO#isatty, IO#tty? に委譲します。

IO#isatty, IO#tty? に委譲します。


@see IO#isatty, IO#tty?

CSV#pos -> Integer (142.0)

IO#pos, IO#tell に委譲します。

IO#pos, IO#tell に委譲します。


@see IO#pos, IO#tell

CSV#tell -> Integer (142.0)

IO#pos, IO#tell に委譲します。

IO#pos, IO#tell に委譲します。


@see IO#pos, IO#tell

CSV#tty? -> bool (142.0)

IO#isatty, IO#tty? に委譲します。

IO#isatty, IO#tty? に委譲します。


@see IO#isatty, IO#tty?

絞り込み条件を変える

CSV#fileno -> Integer (106.0)

IO#fileno, IO#to_i に委譲します。

IO#fileno, IO#to_i に委譲します。

CSV#to_i -> Integer (106.0)

IO#fileno, IO#to_i に委譲します。

IO#fileno, IO#to_i に委譲します。

CSV#binmode -> self (76.0)

IO#binmode に委譲します。

IO#binmode に委譲します。


@see IO#binmode

CSV#binmode? -> bool (76.0)

IO#binmode? に委譲します。

IO#binmode? に委譲します。


@see IO#binmode?

CSV#close -> nil (76.0)

IO#close に委譲します。

IO#close に委譲します。


@see IO#close

絞り込み条件を変える

CSV#close_read -> nil (76.0)

IO#close_read に委譲します。

IO#close_read に委譲します。


@see IO#close_read

CSV#close_write -> nil (76.0)

IO#close_write に委譲します。

IO#close_write に委譲します。


@see IO#close_write

CSV#closed? -> bool (76.0)

IO#closed? に委譲します。

IO#closed? に委譲します。


@see IO#closed?

CSV#internal_encoding -> Encoding | nil (76.0)

IO#internal_encoding に委譲します。

IO#internal_encoding に委譲します。


@see IO#internal_encoding

CSV#path -> String (76.0)

IO#path に委譲します。

IO#path に委譲します。


@see IO#path

絞り込み条件を変える

CSV#pid -> Integer | nil (76.0)

IO#pid に委譲します。

IO#pid に委譲します。


@see IO#pid

CSV#pos=(n) (76.0)

IO#pos= に委譲します。

IO#pos= に委譲します。


@see IO#pos=

CSV#rewind -> 0 (76.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#stat -> File::Stat (76.0)

IO#stat に委譲します。

IO#stat に委譲します。


@see IO#stat

CSV#sync -> bool (76.0)

IO#sync に委譲します。

IO#sync に委譲します。


@see IO#sync

絞り込み条件を変える

CSV#sync=(newstate) (76.0)

IO#sync= に委譲します。

IO#sync= に委譲します。


@see IO#sync=

CSV#external_encoding -> Encoding | nil (58.0)

IO#external_encoding に委譲します。

IO#external_encoding に委譲します。

CSV#fcntl(cmd, arg = 0) -> Integer (58.0)

IO#fcntl に委譲します。

IO#fcntl に委譲します。

CSV#flush -> self (58.0)

IO#flush に委譲します。

IO#flush に委譲します。

CSV#fsync -> 0 | nil (58.0)

IO#fsync に委譲します。

IO#fsync に委譲します。

絞り込み条件を変える

CSV#gets -> Array | CSV::Row (58.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 (58.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 (58.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#inspect -> String (28.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:\"\\\"\">"
//}...