<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>gan2</author_name>
  <author_url>https://blog.hatena.ne.jp/gan2/</author_url>
  <blog_title>gan2 の Ruby 勉強日記</blog_title>
  <blog_url>https://gan2-2.hatenadiary.org/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>いわゆる UNIX の wc コマンドを Ruby で。 filename = ARGV[0] open(filename){|f| l_num = w_num = c_num = 0 while line = f.gets line.chomp! l_num += 1 # splite(/\s+/) で単語に分割した後に # reject{|w| w.empty?} で空白の文字列を除去する。 # (行頭に空白がある場合は # split の結果に空白の文字列が含まれるため) words = line.split(/\s+/).reject{|w| w.empty?} w_num += wo…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fgan2-2.hatenadiary.org%2Fentry%2F20070520%2F1179649079&quot; title=&quot; テキストファイルの行数、単語数、文字数を数える - gan2 の 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>2007-05-20 17:17:59</published>
  <title> テキストファイルの行数、単語数、文字数を数える</title>
  <type>rich</type>
  <url>https://gan2-2.hatenadiary.org/entry/20070520/1179649079</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
