title: Sed command to replace comma-separated values with pipe-separated values
body: <p>My CSV file has records in the following format:</p>
  
  <pre><code>571283,1,"R","01/15/2002","IBMS,SL"
  </code></pre>
  
  <p>I want to convert them to the following format: </p>
  
  <pre><code>571283|1|R|01/15/2002|IBMS,SL
  </code></pre>
  
  <p>I tried this:</p>
  
  <pre><code>sed -e 's/ //g' -e 's/\"\,\"/\|/g' -e 's/\,\"/\|/g' -e 's/\"$//' test.csv
  </code></pre>
  
  <p>but the output I am getting is:</p>
  
  <pre><code>571283,1|R|01/15/2002|IBMS,SL
  </code></pre>
  
  <p>Please advise.</p>