[Google Apps Script] Parse a TSV string

Created on November 29, 2026

You can parse tab-separated values with Utilities.parseCsv() by passing a tab character ("\t") as the second argument. The method returns an array of rows, with one string per field.

function main() {
  const tsv = "one\ttwo\tthree\nfour\tfive\tsix";

  console.log(JSON.stringify(Utilities.parseCsv(tsv, "\t")));
}

The log message contains the parsed rows.

[["one","two","three"],["four","five","six"]]

Reference

Google Apps Script