るりまサーチ

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

別のキーワード

  1. openssl generate
  2. json generate
  3. csv generate_line
  4. csv generate
  5. dsa generate

種類

ライブラリ

クラス

検索結果

CSV.generate_line(row, options = Hash.new) -> String (18113.0)

このメソッドは一つの Array オブジェクトを CSV 文字列に変換するためのショートカットです。 複数行のCSVを扱う際はCSV#<<を使うとより高速です。

...:encoding というキーを使用すると出力のエンコーディングを指定することができます。
:row_sep というキーの値には $/ がセットされます。

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

taro = ['1', 'taro', 'tanaka', '20']
CSV.generate_line(taro...

CSV (66.0)

このクラスは CSV ファイルやデータに対する完全なインターフェイスを提供します。

...parser works in the Encoding of the IO
or String object being read from or written to. Your data is never transcoded
(unless you ask Ruby to transcode it for you) and will literally be parsed in
the Encoding it is in. Thus CSV will return Arrays or Rows of Strings in the
Encoding
of your data. Th...
...is is accomplished by transcoding the parser itself
into your Encoding.

Some transcoding must take place, of course, to accomplish this multiencoding
support. For example, <tt>:col_sep</tt>, <tt>:row_sep</tt>, and
<tt>:quote_char</tt> must be transcoded to match your data. Hopefully this
makes th...
...h an Encoding
that is not ASCII compatible. There's no existing data for CSV to use to
prepare itself and thus you will probably need to manually specify the desired
Encoding
for most of those cases. It will try to guess using the fields in a
row of output though, when using CSV::generate_line() o...