title: Csv optional quote with gawk
body: <p>I need to use "FPAT" or the equivalent function "patsplit" of gawk. But it seems the installed version of gawk is 3.1.5 on our CentOs server.</p>
  
  <p>I tried updating gawk with these commands:</p>
  
  <pre><code>yum update gawk;
  </code></pre>
  
  <p>And the server showed:  "No Packages marked for Update"</p>
  
  <p>I also tried reinstalling gawk with: </p>
  
  <pre><code> yum install gawk;
  </code></pre>
  
  <p>server output: "Package gawk-3.1.5-15.el5.x86_64 already installed and latest version
  "</p>
  
  <p>Where i need gawk 4.0 or above to use those FPAT OR patsplit. And why i need to use them? well i am trying to process a CSV file, and it seems the CSV file has optional quotation and embedded comma.</p>
  
  <p>Example: </p>
  
  <p>From a csv row like this: </p>
  
  <pre><code>this,is,a,"csv,with,embedded coma"
  </code></pre>
  
  <p>I need to split the fields like this: </p>
  
  <pre><code>this
  
  is
  
  a
  
  "csv,with,embedded comma"
  </code></pre>
  
  <p>And here is the gawk code: </p>
  
  <pre><code>awk '{patsplit("this,is,a,\"csv,with,embedded comma\"",a,"([^,]*)|(\"([^\"]|\"\")+\"[^,]*)",seps); for(i=0;i&lt;length(a);i++) print a[i];}';
  </code></pre>
  
  <p>Can anyone help me on this please ?</p>