<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>gom68</author_name>
  <author_url>https://blog.hatena.ne.jp/gom68/</author_url>
  <blog_title>gom68の日記</blog_title>
  <blog_url>https://gom.hatenablog.com/</blog_url>
  <categories>
    <anon>ruby</anon>
  </categories>
  <description>RubyでCSVファイルを読み込んで、新規のCSVファイルに書き込む。 FasterCSVというgemを使った方が速いらしいが、あえてスルー。 新規CSVファイルに書き込む CSVファイルを読み込んで、一部を置換したものを新規CSVとして保存する。 File.openはファイルオブジェクトを返すが、CSV.openはブロックを渡すと、各行の配列を返す。 require 'csv' path = ARGV.shift new_csv = File.join(File.dirname(path), 'hoge.csv') rows=[] CSV.open(path, 'r') do |row| r…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fgom.hatenablog.com%2Fentry%2F20090213%2F1234523232&quot; title=&quot;CSVを読み込む&amp;amp;新規CSVファイルに書き込む - gom68の日記&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>2009-02-13 20:07:12</published>
  <title>CSVを読み込む&amp;新規CSVファイルに書き込む</title>
  <type>rich</type>
  <url>https://gom.hatenablog.com/entry/20090213/1234523232</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
