176件ヒット
[101-176件を表示]
(0.065秒)
種類
- インスタンスメソッド (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件
-
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... -
CSV
. filter(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... -
REXML
:: Instruction . new(target , content = nil) -> REXML :: Instruction (3101.0) -
新たな Instruction オブジェクトを生成します。
新たな Instruction オブジェクトを生成します。
@param target ターゲット
@param content 内容 -
RSS
:: Rss :: Channel :: Item :: Category # content (3001.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item :: Source # content (3001.0) -
@todo
@todo -
RSS
:: TrackBackModel20 :: TrackBackAbout # content (3001.0) -
@todo
@todo -
RSS
:: TrackBackModel20 :: TrackBackPing # content (3001.0) -
@todo
@todo