title: How to read fields enclosed in double quotes using Smooks in WSO2 ESB 4.8.1 from a csv file
body: <p>I have a simple proxy service which reads from csv file and convert it into an XML message using smooks mediator. If the csv file have fields enclosed in single quotes(') then it works great. </p>
  
  <p><strong>FileStructure:</strong></p>
  
  <pre><code>'accountid','accountname','accountlocation'
  '121','dummyaccount','finland' 
  '121','dummyaccount','finland' 
  '121','dummyaccount','finland' 
  </code></pre>
  
  <p>But Unfortunately In my case the fields are enclosed in "double quotes" and Smooks is not parsing the file, it is unable to read the  file.</p>
  
  <p><strong>FileStructureDoubleQuotes:</strong></p>
  
  <pre><code>"accountid","accountname","accountlocation"
  "121","dummyaccount","finland" 
  "121","dummyaccount","finland" 
  "121","dummyaccount","finland" 
  </code></pre>
  
  <p><strong>Proxy Service:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;proxy xmlns="http://ws.apache.org/ns/synapse"
         name="ConvertcsvfiletoXML"
         transports="vfs"
         startOnLoad="true"
         trace="disable"&gt;
     &lt;description/&gt;
     &lt;target&gt;
        &lt;inSequence&gt;
  
           &lt;property name="DISABLE_SMOOKS_RESULT_PAYLOAD" value="true"/&gt;
           &lt;smooks config-key="gov:/SmooksTest/smooks-config.xml"&gt;
              &lt;input type="text"/&gt;
              &lt;output type="xml"/&gt;
           &lt;/smooks&gt;
        &lt;/inSequence&gt;
     &lt;/target&gt;
     &lt;parameter name="transport.PollInterval"&gt;100&lt;/parameter&gt;
     &lt;parameter name="transport.vfs.ActionAfterProcess"&gt;MOVE&lt;/parameter&gt;
     &lt;parameter name="transport.vfs.FileURI"&gt;file:///home/omerkhalid/Documents/SmooksTest/in&lt;/parameter&gt;
     &lt;parameter name="transport.vfs.MoveAfterProcess"&gt;file:///home/omerkhalid/Documents/SmooksTest/out&lt;/parameter&gt;
     &lt;parameter name="transport.vfs.MoveAfterFailure"&gt;file:///home/omerkhalid/Documents/SmooksTest/failed&lt;/parameter&gt;
     &lt;parameter name="transport.vfs.FileNamePattern"&gt;.*.csv&lt;/parameter&gt;
     &lt;parameter name="transport.vfs.ContentType"&gt;text/plain&lt;/parameter&gt;
     &lt;parameter name="transport.vfs.ActionAfterFailure"&gt;MOVE&lt;/parameter&gt;
  &lt;/proxy&gt;
  </code></pre>
  
  <p><strong>Smooks Config File:</strong></p>
  
  <pre><code>&lt;smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
  xmlns:csv="http://www.milyn.org/xsd/smooks/csv-1.1.xsd"
  xmlns:jms="http://www.milyn.org/xsd/smooks/jms-routing-1.2.xsd"
  xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd"&gt;
  
  &lt;params&gt;
  &lt;param name="stream.filter.type"&gt;SAX&lt;/param&gt;
  &lt;param name="stream.filter.readerPoolSize"&gt;300&lt;/param&gt;
  &lt;/params&gt;
  
  &lt;csv:reader fields="id,name,location" separator="," quote="'" skipLines="1" /&gt;
  
  &lt;resource-config selector="csv-record"&gt;
  &lt;resource&gt;org.milyn.delivery.DomModelCreator&lt;/resource&gt;
  &lt;/resource-config&gt;
  
  &lt;ftl:freemarker applyOnElement="csv-record"&gt;
  &lt;ftl:template&gt;/repository/resources/smooks/csv_record_as_xml.ftl&lt;/ftl:template&gt;
  &lt;ftl:use&gt;
  &lt;ftl:bindTo id="csv_record_as_xml"/&gt;
  &lt;/ftl:use&gt;
  &lt;/ftl:freemarker&gt;
  
  &lt;jms:router routeOnElement="csv-record" beanId="csv_record_as_xml" destination="TestQueue"&gt;
  &lt;jms:message&gt;
  &lt;!-- Need to use special FreeMarker variable ".vars" --&gt;
  &lt;jms:correlationIdPattern&gt;${.vars["csv-record"].id}&lt;/jms:correlationIdPattern&gt;
  &lt;/jms:message&gt;
  &lt;jms:jndi properties="/repository/resources/smooks/activemq.sr.jndi.properties" /&gt;
  &lt;jms:highWaterMark mark="10000000"/&gt;
  &lt;/jms:router&gt;
  &lt;/smooks-resource-list&gt;
  </code></pre>
  
  <p>For Single quote following configuration works:</p>
  
  <pre><code>&lt;csv:reader fields="id,name,location" separator="," quote="'" skipLines="1" /&gt;
  </code></pre>
  
  <p>But for double quotes following configuration does not work:</p>
  
  <pre><code>&lt;csv:reader fields="id,name,location" separator="," quote=" " " skipLines="1" /&gt;
  </code></pre>
  
  <p>So what should we do in case of double quotes?
  Note: Changing double quotes to another special symbol is not an open in my case.</p>