るりまサーチ

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

別のキーワード

  1. matrix row
  2. csv header_row?
  3. csv row_sep
  4. row []=
  5. csv row

ライブラリ

クラス

キーワード

検索結果

<< 1 2 > >>

CSV#row_sep -> String (18213.0)

行区切り文字列として使用する文字列を返します。

...行区切り文字列として使用する文字列を返します。

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

csv = CSV.new("header1,header2|row1_1,row1_2", row_sep: "|")
csv.row_sep # => "|"
csv.read # => [["header1", "header2"], ["row1_1", "row1_2"]]
//}

@see CSV.new...

Array#to_csv(**options) -> String (130.0)

CSV.generate_line(self, options) と同様です。

...//emlist[][ruby]{
require 'csv'

p [1, 'Matz', :Ruby, Date.new(1965, 4, 14)].to_csv # => "1,Matz,Ruby,1965-04-14\n"
p [1, 'Matz', :Ruby, Date.new(1965, 4, 14)].to_csv(col_sep: ' ', row_sep: "\r\n") # => "1 Matz Ruby 1965-04-14\r\n"
//}


@see CSV.generate_line...
...:Ruby, Date.new(1965, 4, 14)].to_csv # => "1,Matz,Ruby,1965-04-14\n"
p [1, 'Matz', :Ruby, Date.new(1965, 4, 14)].to_csv(col_sep: ' ', row_sep: "\r\n") # => "1 Matz Ruby 1965-04-14\r\n"
//}

Ruby 3.0 (CSV 3.1.9) から、次のオプションが使えるようにな...

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

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

...区切り文字列を指定します。この文字列はパースする前にデータの
エンコーディングに変換されます。
: :row_sep
行区切りの文字列を指定します。:auto という特別な値をセットすることができます。
:auto を指定した場合...
...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 translation can cause
problems with resetting the document position to where it was before the
read ahead. This String will be transcode...
...が一つだけ
の場合は配列に格納する必要はありません。
全ての組み込みの変換器は、値を変換する前に UTF-8 にエンコーディング変
換を試みます。エンコーディング変換に失敗した場合はフィールドは変換さ
れませ...

CSV#inspect -> String (112.0)

ASCII 互換文字列で自身の情報を表したものを返します。

...ASCII 互換文字列で自身の情報を表したものを返します。

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

csv = CSV.new("header1,header2\nrow1_1,row1_2")
csv.inspect # => "<#CSV io_type:StringIO encoding:UTF-8 lineno:0 col_sep:\",\" row_sep:\"\\n\" quote_char:\"\\\"\">"
//}...

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

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

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

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

taro = ['1', 'taro', 'tanaka', '20']
CSV.generate...

絞り込み条件を変える

CSV::DEFAULT_OPTIONS -> Hash (106.0)

このオプションは呼び出し側で上書きしなかったときに使用するオプションです。

...このオプションは呼び出し側で上書きしなかったときに使用するオプションです。

: :col_sep
","
: :row_sep
:auto
: :quote_char
'"'
: :field_size_limit
nil
: :converters
nil
: :unconverted_fields
nil
: :headers
false
: :return_headers
false
: :header_c...

CSV::Row#to_csv -> String (106.0)

自身を CSV な文字列として返します。ヘッダは使用しません。

...自身を CSV な文字列として返します。ヘッダは使用しません。

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

row = CSV::Row.new(["header1", "header2"], [1, 2])
row.to_csv # => "1,2\n"
row.to_csv( {col_sep: "|", row_sep: "<br>"} ) # => "1|2<br>"
//}...

CSV::Row#to_s -> String (106.0)

自身を CSV な文字列として返します。ヘッダは使用しません。

...自身を CSV な文字列として返します。ヘッダは使用しません。

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

row = CSV::Row.new(["header1", "header2"], [1, 2])
row.to_csv # => "1,2\n"
row.to_csv( {col_sep: "|", row_sep: "<br>"} ) # => "1|2<br>"
//}...

String#parse_csv(**options) -> [String] (106.0)

CSV.parse_line(self, options) と同様です。

...[ruby]{
require "csv"

p "Matz,Ruby\n".parse_csv # => ["Matz", "Ruby"]
p "Matz|Ruby\r\n".parse_csv(col_sep: '|', row_sep: "\r\n") # => ["Matz", "Ruby"]
//}

Ruby 2.6 (CSV 3.0.2) から、次のオプションが使えるようになりました。

//emlist[][ruby]...

CSV (18.0)

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

...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 the entire process feel transparent, since CSV's defa...
...important to note that while all of CSV's core parser is now
Encoding agnostic, some features are not. For example, the built-in
converters will try to transcode data to UTF-8 before making conversions.
Again, you can provide custom converters that are aware of your Encodings to
avoid this translat...

絞り込み条件を変える

<< 1 2 > >>