<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tmtms</author_name>
  <author_url>https://blog.hatena.ne.jp/tmtms/</author_url>
  <blog_title>tmtms のメモ</blog_title>
  <blog_url>https://blog.tmtms.net/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>Ruby の CSV ライブラリはとても便利なんだけど、ひとつだけ問題があって、CSV をパースしたときに nil を返すことがある。 つぎのような CSV をパースすると2番目のカラムが nil になる。4番目のカラムは空文字になるのに！ hoge,,fuga,&quot;&quot;,piyo require 'csv' CSV.parse_line('hoge,,fuga,&quot;&quot;,piyo') #=&gt; [&quot;hoge&quot;, nil, &quot;fuga&quot;, &quot;&quot;, &quot;piyo&quot;] なので CSV のパース結果は全部文字列だと思って使ってるとエラーになってびっくりする。 CSV.parse_line('hoge,,fuga…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.tmtms.net%2Fentry%2F202407-sane_csv&quot; title=&quot;Ruby の CSV が nil を返さないようにする - tmtms のメモ&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>https://cdn-ak.f.st-hatena.com/images/fotolife/t/tmtms/20240714/20240714170348.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2024-07-14 17:06:06</published>
  <title>Ruby の CSV が nil を返さないようにする</title>
  <type>rich</type>
  <url>https://blog.tmtms.net/entry/202407-sane_csv</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
