るりまサーチ

最速Rubyリファレンスマニュアル検索!
108件ヒット [1-100件を表示] (0.122秒)

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. dh p
  5. rsa p

ライブラリ

キーワード

検索結果

<< 1 2 > >>

CSV#col_sep -> String (6202.0)

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

..."csv"

users =<<-EOS
id|first name|last name|age
1|taro|tanaka|20
2|jiro|suzuki|18
3|ami|sato|19
4|yumi|adachi|21
EOS

csv
= CSV.new(users, headers: true, col_sep: "|")
csv
.col_sep # => "|"
csv
.first.to_a # => [["id", "1"], ["first name", "taro"], ["last name", "tanaka"], ["age", "20"]]

csv
= CSV....
...new(users, headers: true)
csv
.col_sep # => ","
csv
.first.to_a # => [["id|first name|last name|age", "1|taro|tanaka|20"]]
//}

@see CSV.new...

CSV#inspect -> String (6202.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#path -> String (6202.0)

IO#path に委譲します。

...IO#path に委譲します。


@see IO#path...

CSV#pid -> Integer | nil (6202.0)

IO#pid に委譲します。

...IO#pid に委譲します。


@see IO#pid...

CSV#pos -> Integer (6202.0)

IO#pos, IO#tell に委譲します。

...IO#pos, IO#tell に委譲します。


@see IO#pos, IO#tell...

絞り込み条件を変える

CSV#row_sep -> String (6202.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...

CSV#tell -> Integer (3102.0)

IO#pos, IO#tell に委譲します。

...IO#pos, IO#tell に委譲します。


@see IO#pos, IO#tell...

CSV#truncate(path, length) -> 0 (202.0)

File#truncate に委譲します。

File#truncate に委譲します。


@see File#truncate

CSV#field_size_limit -> Integer (114.0)

フィールドサイズの最大値を返します。

...csv"

csv
= CSV.new(DATA)
csv
.field_size_limit # => nil
p
csv.read # => [["a", "b"], ["\n2\n2\n", ""]]

DATA.rewind
csv
= CSV.new(DATA, field_size_limit: 4)
p
csv.field_size_limit # => 4
csv
.read # => #<CSV::MalformedCSVError: Field size exceeded on line 2.>

__END__
"a","b"
"
2
2
",""
//}

@see CSV...
<< 1 2 > >>