title: Keeping only certain fields on a CSV file
body: <p>I have a couple of CSV files which have a lot of fields, but I only need to keep a few of them, so I wanted to get rid of the extra data before importing them.</p>
  
  <p>I tought of running:</p>
  
  <pre><code>perl -i.bak -F, -ane 'BEGIN {$,=","} print @F[3..6], @F[9..12]' file.csv
  </code></pre>
  
  <p>Although text fields are quoted, some fields contain commas and this simple solution does not work.</p>