72件ヒット
[1-72件を表示]
(0.150秒)
別のキーワード
種類
- 特異メソッド (48)
- インスタンスメソッド (24)
クラス
- CSV (48)
-
CSV
:: FieldInfo (12) -
URI
:: MailTo (12)
検索結果
先頭5件
-
URI
:: MailTo # headers -> [[String]] (27432.0) -
自身のヘッダーを文字列の配列の配列として設定します。
...自身のヘッダーを文字列の配列の配列として設定します。
例:
require 'uri'
m = URI.parse("mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr")
p m.headers #=> [["subject", "subscribe"], ["cc", "myaddr"]]... -
CSV
:: FieldInfo # header -> String | nil (18326.0) -
利用可能な場合はヘッダを表す文字列を返します。
...list[例][ruby]{
require 'csv'
csv = CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert do |field,field_info|
p field_info.header
Date.parse(field)
end
p csv.first
# => "date1"
# => "date2"
# => #<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)> "date2......":#<Date: 2018-07-10 ((2458310j,0s,0n),+0s,2299161j)>>
//}... -
CSV
. filter(input , options = Hash . new) {|row| . . . } (6232.0) -
このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築 するのに便利です。
...全て output に書き込
みます。
@param input String か IO のインスタンスを指定します。
デフォルトは ARGF です。
@param output String か IO のインスタンスを指定します。
デフォルトは $stdout です。
@param options ":i......":out_", ":output_" で始まるキーは output にだけ適用されます。
それ以外のキーは両方に適用されます。
":output_row_sep" のデフォルト値は $/ です。
//emlist[例: input, output は初期値][ruby]{
# $ echo "header1,header2\nr......; ruby test.rb in.csv
require "csv"
options = { headers: true, return_headers: true, write_headers: true }
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, out... -
CSV
. filter(input , output , options = Hash . new) {|row| . . . } (6232.0) -
このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築 するのに便利です。
...全て output に書き込
みます。
@param input String か IO のインスタンスを指定します。
デフォルトは ARGF です。
@param output String か IO のインスタンスを指定します。
デフォルトは $stdout です。
@param options ":i......":out_", ":output_" で始まるキーは output にだけ適用されます。
それ以外のキーは両方に適用されます。
":output_row_sep" のデフォルト値は $/ です。
//emlist[例: input, output は初期値][ruby]{
# $ echo "header1,header2\nr......; ruby test.rb in.csv
require "csv"
options = { headers: true, return_headers: true, write_headers: true }
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, out... -
CSV
. filter(options = Hash . new) {|row| . . . } (6232.0) -
このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築 するのに便利です。
...全て output に書き込
みます。
@param input String か IO のインスタンスを指定します。
デフォルトは ARGF です。
@param output String か IO のインスタンスを指定します。
デフォルトは $stdout です。
@param options ":i......":out_", ":output_" で始まるキーは output にだけ適用されます。
それ以外のキーは両方に適用されます。
":output_row_sep" のデフォルト値は $/ です。
//emlist[例: input, output は初期値][ruby]{
# $ echo "header1,header2\nr......; ruby test.rb in.csv
require "csv"
options = { headers: true, return_headers: true, write_headers: true }
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, out... -
CSV
. new(data , options = Hash . new) -> CSV (212.0) -
このメソッドは CSV ファイルを読み込んだり、書き出したりするために String か IO のインスタンスをラップします。
...読み込んだり、書き出したりするために
String か IO のインスタンスをラップします。
ラップされた文字列の先頭から読み込むことになります。
文字列に追記したい場合は CSV.generate を使用してください。
他の位置から処理......: :unconverted_fields
真をセットすると CSV::Row#unconverted_fields という変換前のフィー
ルドを返すメソッドを全ての行に追加します。headers オプションによって
追加したヘッダはフィールドではないので
CSV::Row#unconverted_fields......は空の配列を返します。
: :headers
:first_row というシンボルか真を指定すると、CSV ファイルの一行目をヘッダとして扱います。
配列を指定するとそれをヘッダとして扱います。文字列を指定すると CSV.parse_line を
使用して...