216件ヒット
[1-100件を表示]
(0.107秒)
別のキーワード
ライブラリ
- csv (216)
検索結果
先頭5件
-
CSV
# col _ sep -> String (6102.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 (6102.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 (6102.0) -
IO#path に委譲します。
...IO#path に委譲します。
@see IO#path... -
CSV
# pid -> Integer | nil (6102.0) -
IO#pid に委譲します。
...IO#pid に委譲します。
@see IO#pid... -
CSV
# pos -> Integer (6102.0) -
IO#pos, IO#tell に委譲します。
...IO#pos, IO#tell に委譲します。
@see IO#pos, IO#tell... -
CSV
# pos=(n) (6102.0) -
IO#pos= に委譲します。
...IO#pos= に委譲します。
@see IO#pos=... -
CSV
# reopen(io) -> self (6102.0) -
IO#reopen に委譲します。
...IO#reopen に委譲します。
@see IO#reopen... -
CSV
# row _ sep -> String (6102.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
# skip _ blanks? -> bool (6102.0) -
真である場合は、空行を読み飛ばします。
...[例][ruby]{
require "csv"
csv = CSV.new("header1,header2\n\nrow1_1,row1_2")
csv.skip_blanks? # => false
csv.read # => [["header1", "header2"], [], ["row1_1", "row1_2"]]
csv = CSV.new("header1,header2\n\nrow1_1,row1_2", skip_blanks: true)
csv.skip_blanks? # => true
csv.read # => [["......header1", "header2"], ["row1_1", "row1_2"]]
//}
@see CSV.new...