[Google Apps Script] Parse a CSV string

Created on November 30, 2026

Utilities.parseCsv() splits a CSV string into an array of rows containing field values. The spaces after the commas below become part of the corresponding fields.

function main() {
  var csvString = `one, two, three
four, five, six`;

  console.log(Utilities.parseCsv(csvString));
}
 [ [ 'one', ' two', ' three' ], [ 'four', ' five', ' six' ] ]
Google Apps Script