るりまサーチ

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

別のキーワード

  1. rexml/document write
  2. _builtin write
  3. io write
  4. tuple write
  5. csv write_headers?

ライブラリ

クラス

検索結果

<< 1 2 > >>

Pathname#each_line(*args) -> Enumerator (21281.0)

IO.foreach(self.to_s, *args, &block) と同じです。

...ch(self.to_s, *args, &block) と同じです。

//emlist[例][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}

//emlist[例 ブロックを指定][ruby]{
require "pathname"

IO.write("testfile",...
..."line1\nline2,\nline3\n")
Pathname("testfile").each_line {|f| p f }

# => "line1\n"
# => "line2,\n"
# => "line3\n"
//}

//emlist[例 limit を指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line(4) {|f| p f }

# => "line"
# => "1\n"
# => "l...
...ine"
# => "2,\n"
# => "line"
# => "3\n"
//}

//emlist[例 sep を指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line(",") {|f| p f }

# => "line1\nline2,"
# => "\nline3\n"
//}

@
see IO.foreach...

Pathname#each_line(*args) {|line| ... } -> nil (21181.0)

IO.foreach(self.to_s, *args, &block) と同じです。

...ch(self.to_s, *args, &block) と同じです。

//emlist[例][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}

//emlist[例 ブロックを指定][ruby]{
require "pathname"

IO.write("testfile",...
..."line1\nline2,\nline3\n")
Pathname("testfile").each_line {|f| p f }

# => "line1\n"
# => "line2,\n"
# => "line3\n"
//}

//emlist[例 limit を指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line(4) {|f| p f }

# => "line"
# => "1\n"
# => "l...
...ine"
# => "2,\n"
# => "line"
# => "3\n"
//}

//emlist[例 sep を指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line(",") {|f| p f }

# => "line1\nline2,"
# => "\nline3\n"
//}

@
see IO.foreach...

IO#each_line(limit, chomp: false) -> Enumerator (15273.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...Enumerator オブジェクトを返します。

テキスト読み込みメソッドとして動作します。

limit で最大読み込みバイト数を指定します。ただしマルチバイト文字が途中で
切れないように余分に読み込む場合があります。

@
param rs...
...)。
@
param limit 最大の読み込みバイト数
@
param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

@
raise IOError 自身が読み込み用にオープンされていなければ発生します。

//emlist[例: 引数なし][ruby]{
IO...
....write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile")
f.each { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one,\n"
# "2: This is line two,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//emlist[例: 行の区切...

IO#each_line(limit, chomp: false) {|line| ... } -> self (15273.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...Enumerator オブジェクトを返します。

テキスト読み込みメソッドとして動作します。

limit で最大読み込みバイト数を指定します。ただしマルチバイト文字が途中で
切れないように余分に読み込む場合があります。

@
param rs...
...)。
@
param limit 最大の読み込みバイト数
@
param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

@
raise IOError 自身が読み込み用にオープンされていなければ発生します。

//emlist[例: 引数なし][ruby]{
IO...
....write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile")
f.each { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one,\n"
# "2: This is line two,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//emlist[例: 行の区切...

IO#each_line(rs = $/, chomp: false) -> Enumerator (15273.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...Enumerator オブジェクトを返します。

テキスト読み込みメソッドとして動作します。

limit で最大読み込みバイト数を指定します。ただしマルチバイト文字が途中で
切れないように余分に読み込む場合があります。

@
param rs...
...)。
@
param limit 最大の読み込みバイト数
@
param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

@
raise IOError 自身が読み込み用にオープンされていなければ発生します。

//emlist[例: 引数なし][ruby]{
IO...
....write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile")
f.each { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one,\n"
# "2: This is line two,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//emlist[例: 行の区切...

絞り込み条件を変える

IO#each_line(rs, limit, chomp: false) -> Enumerator (15273.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...Enumerator オブジェクトを返します。

テキスト読み込みメソッドとして動作します。

limit で最大読み込みバイト数を指定します。ただしマルチバイト文字が途中で
切れないように余分に読み込む場合があります。

@
param rs...
...)。
@
param limit 最大の読み込みバイト数
@
param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

@
raise IOError 自身が読み込み用にオープンされていなければ発生します。

//emlist[例: 引数なし][ruby]{
IO...
....write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile")
f.each { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one,\n"
# "2: This is line two,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//emlist[例: 行の区切...

IO#each_line(rs, limit, chomp: false) {|line| ... } -> self (15273.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...Enumerator オブジェクトを返します。

テキスト読み込みメソッドとして動作します。

limit で最大読み込みバイト数を指定します。ただしマルチバイト文字が途中で
切れないように余分に読み込む場合があります。

@
param rs...
...)。
@
param limit 最大の読み込みバイト数
@
param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

@
raise IOError 自身が読み込み用にオープンされていなければ発生します。

//emlist[例: 引数なし][ruby]{
IO...
....write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile")
f.each { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one,\n"
# "2: This is line two,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//emlist[例: 行の区切...

IO#each_line(limit) -> Enumerator (15255.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...Enumerator オブジェクトを返します。

テキスト読み込みメソッドとして動作します。

limit で最大読み込みバイト数を指定します。ただしマルチバイト文字が途中で
切れないように余分に読み込む場合があります。

@
param rs...
...
@
param limit 最大の読み込みバイト数

@
raise IOError 自身が読み込み用にオープンされていなければ発生します。

//emlist[例: 引数なし][ruby]{
IO.write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile...
..." }
# => "1: This is line one,\n"
# "2: This is line two,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//emlist[例: 行の区切りに半角カンマ、最大読み取りバイト数に 10 を指定][ruby]{
IO.write("testfile", "This is line one,This is line two,This is line three,And so...

IO#each_line(limit) {|line| ... } -> self (15255.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...Enumerator オブジェクトを返します。

テキスト読み込みメソッドとして動作します。

limit で最大読み込みバイト数を指定します。ただしマルチバイト文字が途中で
切れないように余分に読み込む場合があります。

@
param rs...
...
@
param limit 最大の読み込みバイト数

@
raise IOError 自身が読み込み用にオープンされていなければ発生します。

//emlist[例: 引数なし][ruby]{
IO.write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile...
..." }
# => "1: This is line one,\n"
# "2: This is line two,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//emlist[例: 行の区切りに半角カンマ、最大読み取りバイト数に 10 を指定][ruby]{
IO.write("testfile", "This is line one,This is line two,This is line three,And so...

IO#each_line(rs = $/) -> Enumerator (15255.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...Enumerator オブジェクトを返します。

テキスト読み込みメソッドとして動作します。

limit で最大読み込みバイト数を指定します。ただしマルチバイト文字が途中で
切れないように余分に読み込む場合があります。

@
param rs...
...
@
param limit 最大の読み込みバイト数

@
raise IOError 自身が読み込み用にオープンされていなければ発生します。

//emlist[例: 引数なし][ruby]{
IO.write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile...
..." }
# => "1: This is line one,\n"
# "2: This is line two,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//emlist[例: 行の区切りに半角カンマ、最大読み取りバイト数に 10 を指定][ruby]{
IO.write("testfile", "This is line one,This is line two,This is line three,And so...

絞り込み条件を変える

IO#each_line(rs, limit) -> Enumerator (15255.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...Enumerator オブジェクトを返します。

テキスト読み込みメソッドとして動作します。

limit で最大読み込みバイト数を指定します。ただしマルチバイト文字が途中で
切れないように余分に読み込む場合があります。

@
param rs...
...
@
param limit 最大の読み込みバイト数

@
raise IOError 自身が読み込み用にオープンされていなければ発生します。

//emlist[例: 引数なし][ruby]{
IO.write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile...
..." }
# => "1: This is line one,\n"
# "2: This is line two,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//emlist[例: 行の区切りに半角カンマ、最大読み取りバイト数に 10 を指定][ruby]{
IO.write("testfile", "This is line one,This is line two,This is line three,And so...

IO#each_line(rs, limit) {|line| ... } -> self (15255.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...Enumerator オブジェクトを返します。

テキスト読み込みメソッドとして動作します。

limit で最大読み込みバイト数を指定します。ただしマルチバイト文字が途中で
切れないように余分に読み込む場合があります。

@
param rs...
...
@
param limit 最大の読み込みバイト数

@
raise IOError 自身が読み込み用にオープンされていなければ発生します。

//emlist[例: 引数なし][ruby]{
IO.write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile...
..." }
# => "1: This is line one,\n"
# "2: This is line two,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//emlist[例: 行の区切りに半角カンマ、最大読み取りバイト数に 10 を指定][ruby]{
IO.write("testfile", "This is line one,This is line two,This is line three,And so...

IO#each(limit, chomp: false) -> Enumerator (173.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...Enumerator オブジェクトを返します。

テキスト読み込みメソッドとして動作します。

limit で最大読み込みバイト数を指定します。ただしマルチバイト文字が途中で
切れないように余分に読み込む場合があります。

@
param rs...
...)。
@
param limit 最大の読み込みバイト数
@
param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

@
raise IOError 自身が読み込み用にオープンされていなければ発生します。

//emlist[例: 引数なし][ruby]{
IO...
....write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile")
f.each { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one,\n"
# "2: This is line two,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//emlist[例: 行の区切...

IO#each(limit, chomp: false) {|line| ... } -> self (173.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...Enumerator オブジェクトを返します。

テキスト読み込みメソッドとして動作します。

limit で最大読み込みバイト数を指定します。ただしマルチバイト文字が途中で
切れないように余分に読み込む場合があります。

@
param rs...
...)。
@
param limit 最大の読み込みバイト数
@
param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

@
raise IOError 自身が読み込み用にオープンされていなければ発生します。

//emlist[例: 引数なし][ruby]{
IO...
....write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile")
f.each { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one,\n"
# "2: This is line two,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//emlist[例: 行の区切...
<< 1 2 > >>