title: How Can I Split parseCsvResponse Content into the Way as Google Importing CSV with Separator Type Detect Automatically
body: <pre><code>function parseCsvResponse(csvString) {
      var retArray = [];
   
      var strLines = csvString.split(&quot;, &quot;);
      var strLineLen = strLines.length;
      for (var i = 0; i &lt; strLineLen; i++) {
          var line = strLines[i];
          if (line != '') {
              retArray.push(line.replace(/&quot;/g, &quot;&quot;).split(/;/));
              //replace ; with separator from your CSV file
       }
      }
   
      return retArray;
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/4JMgO.png" rel="nofollow noreferrer">This is the script that I use, and the result is like that</a></p>
  <p>And these are some field in my CSV content wen I open in WordPad : <strong>&quot;sid&quot;,&quot;Detail Order No.&quot;,&quot;Invoice Number&quot;,&quot;Date&quot;,&quot;Location&quot;,&quot;Name&quot;,&quot;Type&quot;,&quot;Status&quot;</strong></p>
  <p>What I want to do is like the result while using Google Sheet Import Function</p>
  <p><a href="https://i.stack.imgur.com/Y15E7.png" rel="nofollow noreferrer">And the result is like that</a></p>