176件ヒット
[1-100件を表示]
(0.101秒)
種類
- インスタンスメソッド (132)
- 特異メソッド (44)
ライブラリ
- csv (33)
-
rexml
/ document (22) - rss (121)
クラス
- CSV (33)
-
REXML
:: Instruction (22) -
RSS
:: Maker :: ChannelBase :: CategoriesBase :: CategoryBase (11) -
RSS
:: Maker :: ChannelBase :: SkipDaysBase :: DayBase (11) -
RSS
:: Maker :: ChannelBase :: SkipHoursBase :: HourBase (11) -
RSS
:: Rss :: Channel :: Item :: Category (22) -
RSS
:: Rss :: Channel :: Item :: Source (22) -
RSS
:: TrackBackModel20 :: TrackBackAbout (22) -
RSS
:: TrackBackModel20 :: TrackBackPing (22)
検索結果
先頭5件
-
REXML
:: Instruction # content=(value) (21200.0) -
XML 処理命令の内容を変更します。
...XML 処理命令の内容を変更します。
@param value 新たなデータ(文字列)... -
RSS
:: Rss :: Channel :: Item :: Category # content= (18101.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item :: Source # content= (18101.0) -
@todo
@todo -
RSS
:: TrackBackModel20 :: TrackBackAbout # content= (18101.0) -
@todo
@todo -
RSS
:: TrackBackModel20 :: TrackBackPing # content= (18101.0) -
@todo
@todo -
RSS
:: Maker :: ChannelBase :: CategoriesBase :: CategoryBase # content=() (18100.0) -
@todo
@todo -
RSS
:: Maker :: ChannelBase :: SkipDaysBase :: DayBase # content=() (18100.0) -
@todo
@todo -
RSS
:: Maker :: ChannelBase :: SkipHoursBase :: HourBase # content=() (18100.0) -
@todo
@todo -
CSV
. filter(input , options = Hash . new) {|row| . . . } (6106.0) -
このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築 するのに便利です。
...のデフォルト値は $/ です。
//emlist[例: input, output は初期値][ruby]{
# $ echo "header1,header2\nrow1_1,row1_2" > in.csv; 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?......//emlist[例: input, output を指定する][ruby]{
require "csv"
content = <<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',content)
options = { headers: true, return_headers: true, write_headers: true }
CSV.filter(File.o......pen("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,20,taro tanaka
# 2,jiro,suzuki,18,jir... -
CSV
. filter(input , output , options = Hash . new) {|row| . . . } (6106.0) -
このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築 するのに便利です。
...のデフォルト値は $/ です。
//emlist[例: input, output は初期値][ruby]{
# $ echo "header1,header2\nrow1_1,row1_2" > in.csv; 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?......//emlist[例: input, output を指定する][ruby]{
require "csv"
content = <<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',content)
options = { headers: true, return_headers: true, write_headers: true }
CSV.filter(File.o......pen("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,20,taro tanaka
# 2,jiro,suzuki,18,jir...