るりまサーチ

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

別のキーワード

  1. readline output=
  2. prettyprint output
  3. irb/output-method print
  4. rake tty_output=
  5. rss output_encoding

種類

ライブラリ

クラス

キーワード

検索結果

CSV (38394.0)

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

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

=== 読み込み

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

csv
_text = <<~CSV_TEXT
Ruby,1995
Rust,2010
CSV
_TEXT

IO.write "sample.csv", csv_text

# ファイルから一行ずつ
CSV
.foreach("sample.csv")...
...010"]

# ファイルから一度に
p CSV.read("sample.csv")
# => [["Ruby", "1995"], ["Rust", "2010"]]

# 文字列から一行ずつ
CSV
.parse(csv_text) do |row|
p row
end
# => ["Ruby", "1995"]
# ["Rust", "2010"]

# 文字列から一度に
p CSV.parse(csv_text)
# => [["Ruby", "1995"], ["Rust...
...generating CSV into a String with 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, w...

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

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

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

ラップされた文字列の先頭から読み込むことになります。
文字列に追記したい場合は CSV.generate を使用し...
...ンスを指定します。
String のインスタンスを指定した場合、CSV#string を使用して
後からデータを取り出すことが出来ます。

@param options CSV をパースするためのオプションをハッシュで指定します。...
...e. If none of those sequences is
found, +data+ is ARGF, Object::STDIN, Object::STDOUT, or
Object::STDERR, or the stream is only available for output, the default
$INPUT_RECORD_SEPARATOR ($/) is used. Obviously,
discovery takes a little time. Set manually if speed is important. Also...

CSV.filter(input, output, options = Hash.new) {|row| ... } (21225.0)

このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築 するのに便利です。

...このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築
するのに便利です。

与えられたブロックに一行ずつ渡されます。ブロックに渡された行は必要であ
れば変更することができます。ブロックの評...
...す。

@param output String か IO のインスタンスを指定します。
デフォルトは $stdout です。

@param options ":in_", ":input_" で始まるキーは input にだけ適用されます。
":out_", ":output_" で始まるキーは output にだけ適...
...":output_row_sep" のデフォルト値は $/ です。

//emlist[例: input, output は初期値][ruby]{
# $ echo "header1,header2\nrow1_1,row1_2" > in.csv; ruby test.rb in.csv

require "csv"

options = { headers: true, return_headers: true, write_headers: true }

CSV
.filter(options)...

CSV.filter(input, options = Hash.new) {|row| ... } (21125.0)

このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築 するのに便利です。

...このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築
するのに便利です。

与えられたブロックに一行ずつ渡されます。ブロックに渡された行は必要であ
れば変更することができます。ブロックの評...
...す。

@param output String か IO のインスタンスを指定します。
デフォルトは $stdout です。

@param options ":in_", ":input_" で始まるキーは input にだけ適用されます。
":out_", ":output_" で始まるキーは output にだけ適...
...":output_row_sep" のデフォルト値は $/ です。

//emlist[例: input, output は初期値][ruby]{
# $ echo "header1,header2\nrow1_1,row1_2" > in.csv; ruby test.rb in.csv

require "csv"

options = { headers: true, return_headers: true, write_headers: true }

CSV
.filter(options)...

CSV.filter(options = Hash.new) {|row| ... } (21125.0)

このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築 するのに便利です。

...このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築
するのに便利です。

与えられたブロックに一行ずつ渡されます。ブロックに渡された行は必要であ
れば変更することができます。ブロックの評...
...す。

@param output String か IO のインスタンスを指定します。
デフォルトは $stdout です。

@param options ":in_", ":input_" で始まるキーは input にだけ適用されます。
":out_", ":output_" で始まるキーは output にだけ適...
...":output_row_sep" のデフォルト値は $/ です。

//emlist[例: input, output は初期値][ruby]{
# $ echo "header1,header2\nrow1_1,row1_2" > in.csv; ruby test.rb in.csv

require "csv"

options = { headers: true, return_headers: true, write_headers: true }

CSV
.filter(options)...

絞り込み条件を変える

NEWS for Ruby 3.1.0 (36.0)

NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...新されました。
* RubyGems 3.3.3
* base64 0.1.1
* benchmark 0.2.0
* bigdecimal 3.1.1
* bundler 2.3.3
* cgi 0.3.1
* csv 3.2.2
* date 3.2.2
* did_you_mean 1.6.1
* digest 3.1.0
* drb 2.1.0
* erb 2.2.3
* error_highlight 0.3.0
* etc 1.3.0...
...`T` must be compatible with the `_Output` interface.
# `PrettyPrint[String]` is ok, but `PrettyPrint[Integer]` is a type error.
class PrettyPrint[T < _Output]
interface _Output
def <<: (String) -> void
end

attr_reader output: T

def initialize: (T output) -> void
end
//}

* ジェネ...

NEWS for Ruby 3.0.0 (18.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ptions

=== `--help` option

When the environment variable `RUBY_PAGER` or `PAGER` is present and has
a non-empty value, and the standard input and output are tty, the `--help`
option shows the help message via the pager designated by the value.
16754

=== `--backtrace-limit` option

The `--backtrac...
...is Ractor compatible.
* Bundler
* Update to Bundler 2.2.3
* CGI
* Update to 0.2.0
* This version is Ractor compatible.
* CSV
* Update to CSV 3.1.9
* Date
* Update to Date 3.1.1
* This version is Ractor compatible.
* Digest
* Update to Digest 3.0.0
* This ver...