ライブラリ
- ビルトイン (205)
- csv (66)
-
irb
/ context (22) -
irb
/ input-method (55) - openssl (22)
- pathname (22)
- stringio (22)
- zlib (110)
クラス
-
ARGF
. class (99) - CSV (66)
- IO (73)
-
IRB
:: Context (22) -
IRB
:: ReadlineInputMethod (55) - Pathname (22)
- StringIO (22)
- Thread (22)
-
Thread
:: Backtrace :: Location (11) -
Zlib
:: GzipReader (110)
モジュール
-
OpenSSL
:: Buffering (22)
キーワード
-
add
_ trace _ func (11) - binread (11)
- convert (33)
- each (22)
-
each
_ line (22) - encoding (11)
- eof (11)
- eof? (22)
-
field
_ size _ limit (11) - gets (11)
- lineno (22)
- lineno= (11)
- pread (7)
-
readable
_ atfer _ eof? (11) - readline (110)
- readlines (121)
-
set
_ trace _ func (11) -
to
_ a (33) -
use
_ readline (11) -
use
_ readline? (11)
検索結果
先頭5件
-
IRB
:: ReadlineInputMethod # line(line _ no) -> String (24225.0) -
引数 line_no で指定した過去の入力を行単位で返します。
...引数 line_no で指定した過去の入力を行単位で返します。
@param line_no 取得する行番号を整数で指定します。... -
Zlib
:: GzipReader # readline(rs = $ / ) -> String (15207.0) -
IO クラスの同名メソッドIO#readlineと同じです。
...IO クラスの同名メソッドIO#readlineと同じです。
但し、gzip ファイル中に
エラーがあった場合 Zlib::Error 例外や
Zlib::GzipFile::Error 例外が発生します。
gzip ファイルのフッターの処理に注意して下さい。
gzip ファイルのフッター......には圧縮前データのチェックサムが
記録されています。GzipReader オブジェクトは、次の時に展開した
データとフッターの照合を行い、エラーがあった場合は
Zlib::GzipFile::NoFooter, Zlib::GzipFile::CRCError,
Zlib::GzipFile::LengthError 例外......時。
すなわち Zlib::GzipReader#read,
Zlib::GzipReader#gets メソッド等が nil を返す時。
* EOF まで読み込んだ後、Zlib::GzipFile#close メソッドが
呼び出された時。
* EOF まで読み込んだ後、Zlib::GzipReader#unused メソッドが
呼び... -
Zlib
:: GzipReader # readlines(rs = $ / ) -> Array (15207.0) -
IO クラスの同名メソッドIO#readlinesと同じです。
...IO クラスの同名メソッドIO#readlinesと同じです。
但し、gzip ファイル中に
エラーがあった場合 Zlib::Error 例外や
Zlib::GzipFile::Error 例外が発生します。
gzip ファイルのフッターの処理に注意して下さい。
gzip ファイルのフッター......には圧縮前データのチェックサムが
記録されています。GzipReader オブジェクトは、次の時に展開した
データとフッターの照合を行い、エラーがあった場合は
Zlib::GzipFile::NoFooter, Zlib::GzipFile::CRCError,
Zlib::GzipFile::LengthError 例外......時。
すなわち Zlib::GzipReader#read,
Zlib::GzipReader#gets メソッド等が nil を返す時。
* EOF まで読み込んだ後、Zlib::GzipFile#close メソッドが
呼び出された時。
* EOF まで読み込んだ後、Zlib::GzipReader#unused メソッドが
呼び... -
IO
# readlines(limit , chomp: false) -> [String] (12261.0) -
データを全て読み込んで、その各行を要素としてもつ配列を返します。 既に EOF に達していれば空配列 [] を返します。
...", "line1,\nline2,\nline3,\n")
File.open("testfile") { |f| p f.readlines } # => ["line1,\n", "line2,\n", "line3,\n"]
File.open("testfile") { |f| p f.readlines(3) } # => ["lin", "e1,", "\n", "lin", "e2,", "\n", "lin", "e3,", "\n"]
File.open("testfile") { |f| p f.readlines(",") } # => ["line1,"......, "\nline2,", "\nline3,", "\n"]
//}
//emlist[例: rsを取り除く(chomp = true)][ruby]{
IO.write("testfile", "line1,\rline2,\r\nline3,\n")
File.open("testfile") { |f| p f.readlines(chomp: true) } # => ["line1,\rline2,", "line3,"]
File.open("testfile") { |f| p f.readlines("\r", chomp: tr......ue) } # => ["line1,", "line2,", "\nline3,\n"]
//}
@see $/, IO#gets... -
IO
# readlines(rs = $ / , chomp: false) -> [String] (12261.0) -
データを全て読み込んで、その各行を要素としてもつ配列を返します。 既に EOF に達していれば空配列 [] を返します。
...", "line1,\nline2,\nline3,\n")
File.open("testfile") { |f| p f.readlines } # => ["line1,\n", "line2,\n", "line3,\n"]
File.open("testfile") { |f| p f.readlines(3) } # => ["lin", "e1,", "\n", "lin", "e2,", "\n", "lin", "e3,", "\n"]
File.open("testfile") { |f| p f.readlines(",") } # => ["line1,"......, "\nline2,", "\nline3,", "\n"]
//}
//emlist[例: rsを取り除く(chomp = true)][ruby]{
IO.write("testfile", "line1,\rline2,\r\nline3,\n")
File.open("testfile") { |f| p f.readlines(chomp: true) } # => ["line1,\rline2,", "line3,"]
File.open("testfile") { |f| p f.readlines("\r", chomp: tr......ue) } # => ["line1,", "line2,", "\nline3,\n"]
//}
@see $/, IO#gets... -
IO
# readlines(rs , limit , chomp: false) -> [String] (12261.0) -
データを全て読み込んで、その各行を要素としてもつ配列を返します。 既に EOF に達していれば空配列 [] を返します。
...", "line1,\nline2,\nline3,\n")
File.open("testfile") { |f| p f.readlines } # => ["line1,\n", "line2,\n", "line3,\n"]
File.open("testfile") { |f| p f.readlines(3) } # => ["lin", "e1,", "\n", "lin", "e2,", "\n", "lin", "e3,", "\n"]
File.open("testfile") { |f| p f.readlines(",") } # => ["line1,"......, "\nline2,", "\nline3,", "\n"]
//}
//emlist[例: rsを取り除く(chomp = true)][ruby]{
IO.write("testfile", "line1,\rline2,\r\nline3,\n")
File.open("testfile") { |f| p f.readlines(chomp: true) } # => ["line1,\rline2,", "line3,"]
File.open("testfile") { |f| p f.readlines("\r", chomp: tr......ue) } # => ["line1,", "line2,", "\nline3,\n"]
//}
@see $/, IO#gets... -
IO
# readlines(limit) -> [String] (12231.0) -
データを全て読み込んで、その各行を要素としてもつ配列を返します。 既に EOF に達していれば空配列 [] を返します。
...", "line1,\nline2,\nline3,\n")
File.open("testfile") { |f| p f.readlines } # => ["line1,\n", "line2,\n", "line3,\n"]
File.open("testfile") { |f| p f.readlines(3) } # => ["lin", "e1,", "\n", "lin", "e2,", "\n", "lin", "e3,", "\n"]
File.open("testfile") { |f| p f.readlines(",") } # => ["line1,"......, "\nline2,", "\nline3,", "\n"]
//}
@see $/, IO#gets... -
IO
# readlines(rs = $ / ) -> [String] (12231.0) -
データを全て読み込んで、その各行を要素としてもつ配列を返します。 既に EOF に達していれば空配列 [] を返します。
...", "line1,\nline2,\nline3,\n")
File.open("testfile") { |f| p f.readlines } # => ["line1,\n", "line2,\n", "line3,\n"]
File.open("testfile") { |f| p f.readlines(3) } # => ["lin", "e1,", "\n", "lin", "e2,", "\n", "lin", "e3,", "\n"]
File.open("testfile") { |f| p f.readlines(",") } # => ["line1,"......, "\nline2,", "\nline3,", "\n"]
//}
@see $/, IO#gets... -
IO
# readlines(rs , limit) -> [String] (12231.0) -
データを全て読み込んで、その各行を要素としてもつ配列を返します。 既に EOF に達していれば空配列 [] を返します。
...", "line1,\nline2,\nline3,\n")
File.open("testfile") { |f| p f.readlines } # => ["line1,\n", "line2,\n", "line3,\n"]
File.open("testfile") { |f| p f.readlines(3) } # => ["lin", "e1,", "\n", "lin", "e2,", "\n", "lin", "e3,", "\n"]
File.open("testfile") { |f| p f.readlines(",") } # => ["line1,"......, "\nline2,", "\nline3,", "\n"]
//}
@see $/, IO#gets... -
IO
# readline(limit) -> String (12213.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には EOFError が発生します。
...オープンされていなければ発生します。
f = File.new("oneline_file")
f.readline #=> "This is line one\n"
$_ #=> "This is line one\n"
f.readline #=> EOFError
$_ #=> nil... -
IO
# readline(limit , chomp: false) -> String (12213.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には EOFError が発生します。
...オープンされていなければ発生します。
f = File.new("oneline_file")
f.readline #=> "This is line one\n"
$_ #=> "This is line one\n"
f.readline #=> EOFError
$_ #=> nil... -
IO
# readline(rs = $ / ) -> String (12213.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には EOFError が発生します。
...オープンされていなければ発生します。
f = File.new("oneline_file")
f.readline #=> "This is line one\n"
$_ #=> "This is line one\n"
f.readline #=> EOFError
$_ #=> nil... -
IO
# readline(rs = $ / , chomp: false) -> String (12213.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には EOFError が発生します。
...オープンされていなければ発生します。
f = File.new("oneline_file")
f.readline #=> "This is line one\n"
$_ #=> "This is line one\n"
f.readline #=> EOFError
$_ #=> nil... -
IO
# readline(rs , limit) -> String (12213.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には EOFError が発生します。
...オープンされていなければ発生します。
f = File.new("oneline_file")
f.readline #=> "This is line one\n"
$_ #=> "This is line one\n"
f.readline #=> EOFError
$_ #=> nil... -
IO
# readline(rs , limit , chomp: false) -> String (12213.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には EOFError が発生します。
...オープンされていなければ発生します。
f = File.new("oneline_file")
f.readline #=> "This is line one\n"
$_ #=> "This is line one\n"
f.readline #=> EOFError
$_ #=> nil... -
ARGF
. class # readlines(limit) -> Array (12207.0) -
ARGFの各行を配列に読み込んで返します。rsがnilの場合は要素に各ファイルを すべて読み込んだ配列を返します。
...。rsがnilの場合は要素に各ファイルを
すべて読み込んだ配列を返します。
@param rs 行区切り文字
@param limit 最大の読み込みバイト数
lines = ARGF.readlines
lines[0] # => "This is line one\n"
@see $/, Kernel.#readlines, IO#readlines...