るりまサーチ

最速Rubyリファレンスマニュアル検索!
37件ヒット [1-37件を表示] (0.137秒)
トップページ > クエリ:I[x] > クエリ:IO[x] > クエリ:-[x] > クエリ:first[x] > クエリ:generate[x]

別のキーワード

  1. io popen
  2. io pipe
  3. io readlines
  4. io each
  5. io each_line

種類

ライブラリ

クラス

キーワード

検索結果

CSV.generate(str = "", options = Hash.new) {|csv| ... } -> String (18419.0)

このメソッドは与えられた文字列をラップして CSV のオブジェクトとしてブロックに渡します。 ブロック内で CSV オブジェクトに行を追加することができます。 ブロックを評価した結果は文字列を返します。

...空文字列です。

@param options CSV.new のオプションと同じオプションを指定できます。
:encoding というキーを使用すると出力のエンコーディングを指定することができます。
ASCII と互換性の無い文字エン...
...ます。

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

text =<<-EOS
i
d,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
EOS

csv = CSV.generate(text, headers: true) do |csv|
csv.add_row(["5", "saburo", "kondo", "34"])
end

print csv
# => id,first name,last name,age...
...# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,21
# 5,saburo,kondo,34
//}

@see CSV.new...
...要があります。

@param options CSV.new のオプションと同じオプションを指定できます。
:encoding というキーを使用すると出力のエンコーディングを指定することができます。
ASCII と互換性の無い文字エン...

ruby 1.8.2 feature (1332.0)

ruby 1.8.2 feature ruby 1.8.2 での ruby 1.8.1 からの変更点です。

...変更
* [api]: 拡張ライブラリ API
* [lib]: ライブラリ
*レベル
* [bug]: バグ修正
* [new]: 追加されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど
* 互換性のある変更
* only backward-compatibility
* 影響...
...変更)
* [experimental]: 変更の中でも特に実験的なもの(将来再考して欲しいもの?)
* [obsolete]: 廃止された(される予定の)機能
* [platform]: 対応プラットフォームの追加

== 1.8.1 (2003-12-25) -> 1.8.2 (2004-12-25)

* cgi/session においてク...
...[lib] [obsolete]
: CSV::Cell [lib] [obsolete]
CSV::Row と CSV::Cell が deprecated になりました。

: CSV.open, CSV.parse, and CSV,generate
必要ならばユーザが binmode をセットしなければならなくなりました。

: CSV.read [lib] [new]
: CSV.readlines [lib]...

CSV.new(data, options = Hash.new) -> CSV (400.0)

このメソッドは CSV ファイルを読み込んだり、書き出したりするために String か IO のインスタンスをラップします。

...み込んだり、書き出したりするために
String か IO のインスタンスをラップします。

ラップされた文字列の先頭から読み込むことになります。
文字列に追記したい場合は CSV.generate を使用してください。
他の位置から処理し...
...stream is only available for output, the default
$INPUT_RECORD_SEPARATOR ($/) is used. Obviously,
discovery takes a little time. Set manually if speed is important. Also
note that IO objects should be opened in binary mode on Windows if this
feature will be used as the line-ending tr...
...this character to be an
escaped quote.
この文字列はパースする前にデータのエンコーディングに変換されます。
: :field_size_limit
This is a maximum size CSV will read ahead looking for the closing quote
for a field. (In truth, it reads to the first line ending...

NEWS for Ruby 3.0.0 (390.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the behavior of Procs
accepting...
...tion warning
# 3.0 => a=>1}, {}]
//}

* Arguments forwarding (`...`) now supports leading arguments.
16378

//emlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}

* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern matching is redesig...
...auto_compact have been added to control when compaction runs. Setting `auto_compact=` to `true` will cause compaction to occur during major collections. At the moment, compaction adds significant overhead to major collections, so please test first! 17176
* Hash
* Hash#transform_keys and Has...