12件ヒット
[1-12件を表示]
(0.012秒)
ライブラリ
- csv (12)
検索結果
先頭1件
-
CSV (19.0)
-
このクラスは CSV ファイルやデータに対する完全なインターフェイスを提供します。
...<< ["another", "row"]
# ...
end
//}
=== 一行変換
//emlist[][ruby]{
require 'csv'
csv_string = ["CSV", "data"].to_csv # => "CSV,data"
csv_array = "CSV,String".parse_csv # => ["CSV", "String"]
//}
=== ショートカット
//emlist[][ruby]{
require 'csv'
CSV { |csv_out| cs......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. This is accomplished by transcoding the parser itself
into your Encoding.
Some transcoding mus......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() or Array#to_csv()....