163件ヒット
[1-100件を表示]
(0.035秒)
ライブラリ
- csv (84)
- psych (19)
- readline (12)
- stringio (36)
-
webrick
/ log (12)
クラス
- CSV (84)
- StringIO (36)
-
WEBrick
:: BasicLog (12)
モジュール
- Psych (19)
オブジェクト
-
Readline
:: HISTORY (12)
検索結果
先頭5件
- Readline
:: HISTORY . <<(string) -> self - StringIO
. new(string = & # 39;& # 39; , mode = & # 39;r+& # 39;) -> StringIO - StringIO
. open(string = & # 39;& # 39; , mode = & # 39;r+& # 39;) -> StringIO - StringIO
. open(string = & # 39;& # 39; , mode = & # 39;r+& # 39;) {|io| . . . } -> object - CSV
. filter(input , options = Hash . new) {|row| . . . }
-
Readline
:: HISTORY . <<(string) -> self (18242.0) -
ヒストリの最後に string で指定した文字列を追加します。 self を返します。
...ヒストリの最後に string で指定した文字列を追加します。
self を返します。
@param string 文字列を指定します。
例: "foo"を追加する。
require "readline"
Readline::HISTORY << "foo"
p Readline::HISTORY[-1] #=> "foo"
例: "foo"、"bar"を追加す......る。
require "readline"
Readline::HISTORY << "foo" << "bar"
p Readline::HISTORY[-1] #=> "bar"
p Readline::HISTORY[-2] #=> "foo"
@see Readline::HISTORY.push... -
StringIO
. new(string = & # 39;& # 39; , mode = & # 39;r+& # 39;) -> StringIO (3240.0) -
StringIO オブジェクトを生成して返します。
...
StringIO オブジェクトを生成して返します。
与えられた string がフリーズされている場合には、mode はデフォルトでは読み取りのみに設定されます。
ブロックを与えた場合は生成した StringIO オブジェクトを引数としてブロッ......価してその結果を返します。
@param string 生成される StringIO のデータを文字列で指定します。
この文字列はバッファとして使われます。StringIO#write などによって、
string 自身も書き換えられます。
@param......se Errno::EACCES string がフリーズされていて、mode が書き込み可能に設定されている場合に発生します。
//emlist[例][ruby]{
require 'stringio'
s = "foo"
io = StringIO.new(s)
p io.getc # => 102
p io.pos # => 1
p io.size # => 3
io << "bar"
p io.s... -
StringIO
. open(string = & # 39;& # 39; , mode = & # 39;r+& # 39;) -> StringIO (3240.0) -
StringIO オブジェクトを生成して返します。
...
StringIO オブジェクトを生成して返します。
与えられた string がフリーズされている場合には、mode はデフォルトでは読み取りのみに設定されます。
ブロックを与えた場合は生成した StringIO オブジェクトを引数としてブロッ......価してその結果を返します。
@param string 生成される StringIO のデータを文字列で指定します。
この文字列はバッファとして使われます。StringIO#write などによって、
string 自身も書き換えられます。
@param......se Errno::EACCES string がフリーズされていて、mode が書き込み可能に設定されている場合に発生します。
//emlist[例][ruby]{
require 'stringio'
s = "foo"
io = StringIO.new(s)
p io.getc # => 102
p io.pos # => 1
p io.size # => 3
io << "bar"
p io.s... -
StringIO
. open(string = & # 39;& # 39; , mode = & # 39;r+& # 39;) {|io| . . . } -> object (3140.0) -
StringIO オブジェクトを生成して返します。
...
StringIO オブジェクトを生成して返します。
与えられた string がフリーズされている場合には、mode はデフォルトでは読み取りのみに設定されます。
ブロックを与えた場合は生成した StringIO オブジェクトを引数としてブロッ......価してその結果を返します。
@param string 生成される StringIO のデータを文字列で指定します。
この文字列はバッファとして使われます。StringIO#write などによって、
string 自身も書き換えられます。
@param......se Errno::EACCES string がフリーズされていて、mode が書き込み可能に設定されている場合に発生します。
//emlist[例][ruby]{
require 'stringio'
s = "foo"
io = StringIO.new(s)
p io.getc # => 102
p io.pos # => 1
p io.size # => 3
io << "bar"
p io.s... -
CSV
. filter(input , options = Hash . new) {|row| . . . } (43.0) -
このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築 するのに便利です。
...ブロックの評価後に行を全て output に書き込
みます。
@param input String か IO のインスタンスを指定します。
デフォルトは ARGF です。
@param output String か IO のインスタンスを指定します。
デフォルトは $std......CSV.filter(options) do |row|
if row.header_row?
row << "header3"
next
end
row << "row1_3"
end
# => header1,header2,header3
# row1_1,row1_2,row1_3
//}
//emlist[例: input, output を指定する][ruby]{
require "csv"
content = <<EOS
id,first name,last name,age
1,taro,tanaka,20
2,jiro,......write_headers: true }
CSV.filter(File.open("test.csv"), File.open("out.csv", "w"), options) do |row|
if row.header_row?
row << "full name"
next
end
row << row["first name"] + " " + row["last name"]
end
# out.csv の内容
# => id,first name,last name,age,full name
# 1,taro,tanaka... -
CSV
. filter(input , output , options = Hash . new) {|row| . . . } (43.0) -
このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築 するのに便利です。
...ブロックの評価後に行を全て output に書き込
みます。
@param input String か IO のインスタンスを指定します。
デフォルトは ARGF です。
@param output String か IO のインスタンスを指定します。
デフォルトは $std......CSV.filter(options) do |row|
if row.header_row?
row << "header3"
next
end
row << "row1_3"
end
# => header1,header2,header3
# row1_1,row1_2,row1_3
//}
//emlist[例: input, output を指定する][ruby]{
require "csv"
content = <<EOS
id,first name,last name,age
1,taro,tanaka,20
2,jiro,......write_headers: true }
CSV.filter(File.open("test.csv"), File.open("out.csv", "w"), options) do |row|
if row.header_row?
row << "full name"
next
end
row << row["first name"] + " " + row["last name"]
end
# out.csv の内容
# => id,first name,last name,age,full name
# 1,taro,tanaka... -
CSV
. filter(options = Hash . new) {|row| . . . } (43.0) -
このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築 するのに便利です。
...ブロックの評価後に行を全て output に書き込
みます。
@param input String か IO のインスタンスを指定します。
デフォルトは ARGF です。
@param output String か IO のインスタンスを指定します。
デフォルトは $std......CSV.filter(options) do |row|
if row.header_row?
row << "header3"
next
end
row << "row1_3"
end
# => header1,header2,header3
# row1_1,row1_2,row1_3
//}
//emlist[例: input, output を指定する][ruby]{
require "csv"
content = <<EOS
id,first name,last name,age
1,taro,tanaka,20
2,jiro,......write_headers: true }
CSV.filter(File.open("test.csv"), File.open("out.csv", "w"), options) do |row|
if row.header_row?
row << "full name"
next
end
row << row["first name"] + " " + row["last name"]
end
# out.csv の内容
# => id,first name,last name,age,full name
# 1,taro,tanaka... -
CSV
. open(filename , mode = "rb" , options = Hash . new) -> CSV (43.0) -
このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
...* IO#internal_encoding
* IO#ioctl
* IO#isatty
* File#path
* IO#pid
* IO#pos
* IO#pos=
* IO#reopen
* IO#seek
* IO#stat
* StringIO#string
* IO#sync
* IO#sync=
* IO#tell
* IO#to_i
* IO#to_io
* File#truncate
* IO#tty?
@param filename ファイル名を指定しま......と同じオプションを指定できます。
//emlist[例 読み取り・ブロック指定なし][ruby]{
require "csv"
File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
csv = CSV.open("test.csv", headers: true)
csv.c......id":"1" "first name":"taro" "last name":"tanaka" "age":"20">
//}
//emlist[例 読み取り・ブロック指定あり][ruby]{
require "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
File.write("test.csv", users)
CSV.open("test.c... -
CSV
. open(filename , mode = "rb" , options = Hash . new) {|csv| . . . } -> nil (43.0) -
このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
...* IO#internal_encoding
* IO#ioctl
* IO#isatty
* File#path
* IO#pid
* IO#pos
* IO#pos=
* IO#reopen
* IO#seek
* IO#stat
* StringIO#string
* IO#sync
* IO#sync=
* IO#tell
* IO#to_i
* IO#to_io
* File#truncate
* IO#tty?
@param filename ファイル名を指定しま......と同じオプションを指定できます。
//emlist[例 読み取り・ブロック指定なし][ruby]{
require "csv"
File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
csv = CSV.open("test.csv", headers: true)
csv.c......id":"1" "first name":"taro" "last name":"tanaka" "age":"20">
//}
//emlist[例 読み取り・ブロック指定あり][ruby]{
require "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
File.write("test.csv", users)
CSV.open("test.c...