Skip to content

Instantly share code, notes, and snippets.

@milliethe
milliethe / parseCsv.gs
Created October 22, 2020 21:16 — forked from simonjamain/parseCsv.gs
fix the bug on Utilities.parseCsv() google script function which does not allow newlines in csv strings
function parseCsv(csvString, delimiter) {
var sanitizedString = csvString.replace(/(["'])(?:(?=(\\?))\2[\s\S])*?\1/g, function(e){return e.replace(/\r?\n|\r/g, ' ') });
return Utilities.parseCsv(sanitizedString, delimiter)
}