title: Split string on commas but ignore commas within double-quotes using shell scripting in a .csv file?
body: <p><strong>Sample 'null.csv' file contains</strong></p>
  
  <blockquote>
    <p>71131940,2015-05-01,"JEWELLERY,ITEM",P,,W</p>
  </blockquote>
  
  <p>I have a .csv file in which I want to handle commas(,) and null values(,,) so that when I split each line of the file using (,) it ignores commas within double-quotes and does not give the output like this given below.</p>
  
  <blockquote>
    <p>71131940,2015-05-01,JEWELLERY,ITEM,P,,W</p>
  </blockquote>
  
  <p>I handled null values i.e (,,) by replaces it with (,0,) using sed command</p>
  
  <blockquote>
    <p>sed -i -e "s/,,/,0,/g" null.csv</p>
  </blockquote>
  
  <p>and got output something like</p>
  
  <pre><code>71131940,2015-05-01,JEWELLERY,ITEM,P,0,W
  </code></pre>
  
  <p>But the problem is that, in here I don't want to split "JEWELLERY,ITEM" into
  JEWELLERY,ITEM .</p>
  
  <p>Any kind of help will be appreciated.</p>