title: Ruby CSV - get current line/row number
body: <p>I'm trying to work out how to get the current line/row number from Ruby CSV. This is my code:</p>
  
  <pre><code>options = {:encoding =&gt; 'UTF-8', :skip_blanks =&gt; true}
  CSV.foreach("data.csv", options, ) do |row, i|
     puts i
  end
  </code></pre>
  
  <p>But this doesn't seem to work as expected. Is there a way to do this?</p>