title: Ruby Read and Write CSV with Quotes
body: <p>I'd like to read in a csv row, update one field then output the row again with quotes.</p>
  
  <pre><code>Row Example Input =&gt; "Joe", "Blow", "joe@blow.com"
  Desired Row Example Output =&gt; "Joe", "Blow", "xxxx@xxxx.xxx"
  
  My script below outputs =&gt; Joe, Blow, xxxx@xxxx.xxx
  </code></pre>
  
  <p>It loses the double quotes which I want to retain.</p>
  
  <p>I've tried various options but no joy so far .. any tips? </p>
  
  <p>Many thanks!</p>
  
  <pre><code>require 'csv'
  
  CSV.foreach('transactions.csv',
              :quote_char=&gt;'"',
              :col_sep =&gt;",", 
              :headers =&gt; true, 
              :header_converters =&gt; :symbol ) do |row| 
  
  row[:customer_email] = 'xxxx@xxxx.xxx'
  
  puts row
  
  end
  </code></pre>