<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>takuya_1st</author_name>
  <author_url>https://blog.hatena.ne.jp/takuya_1st/</author_url>
  <blog_title>それマグで！</blog_title>
  <blog_url>https://takuya-1st.hatenablog.jp/</blog_url>
  <categories>
    <anon>ruby</anon>
  </categories>
  <description>Rubyを使ってバッチ処理や集合演算をするときに、ファイルをどこまで読み込んだかパーセント表示したい。表示しておかないとどこまで処理しているかが分からないので不安になる。処理状況を表示する。File#linenoを使えばいいかと思ったが、File#linenoはFile#readやFile#readlinesなどを一度実行しないと、ファイルの行数が分からないようなので。。。ポインタの位置から進捗を見ることにする。 進捗率の表示 進捗を％表示で見せるサンプル open filename do |f| size = File.size f.path f.each_line do |line| #d…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftakuya-1st.hatenablog.jp%2Fentry%2F20100104%2F1262566732&quot; title=&quot;Rubyで巨大ファイルを読み込むときに進捗率を表示したい - それマグで！&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2010-01-04 09:58:52</published>
  <title>Rubyで巨大ファイルを読み込むときに進捗率を表示したい</title>
  <type>rich</type>
  <url>https://takuya-1st.hatenablog.jp/entry/20100104/1262566732</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
