るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.022秒)
トップページ > クエリ:io[x] > クエリ:readlines[x] > 種類:クラス[x]

別のキーワード

  1. io popen
  2. io pipe
  3. io each_line
  4. io each

ライブラリ

キーワード

検索結果

IO (6409.0)

基本的な入出力機能のためのクラスです。

...基本的な入出力機能のためのクラスです。


File::Constants は、File から IO へ移動しました。

===[a:m17n] 多言語化と IO のエンコーディング

IO
オブジェクトはエンコーディングを持ちます。
エンコーディングの影響を受けるメ...
...と受けないメソッドがあります。

影響を受けるメソッドでは、IO のエンコーディングに従い読み込まれた文字列のエンコーディングが決定されます。
また IO のエンコーディングを適切に設定することにより、読み込み時...
...ないメソッド

IO
の読み込みメソッドは2種類存在します。
テキスト読み込みメソッドとバイナリ読み込みメソッドです。

テキスト読み込みメソッドは IO のエンコーディングの影響をうけます。
詳しくは「io_encoding」を参...

CSV (31.0)

このクラスは 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") do |row|
p row
end
# => ["Ruby", "1995"]
# ["Rust", "2...
...<< %w{my data here} } # to $stderr
//}

=== CSV と文字エンコーディング (M17n or Multilingualization)

This new CSV parser is m17n savvy. The parser works in the Encoding of the IO
or String object being read from or written to. Your data is never transcoded
(unless you ask Ruby to tran...
...the target Encoding to avoid the translation.

It's also 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 converte...