Skip to content

Comma-separated list to an array

Split a comma-separated line into items and emit a JavaScript array.

  1. 1.Text to array converter

Have a single line of comma-separated values — a CSV row, a tag list, a copied cell — and need it as an array? This splits on the comma, trims the space that usually follows it, and writes each value as a quoted item in a JavaScript array literal.

It handles the everyday case where the values themselves contain no commas. For a real CSV file with quoted fields, header rows and multiple records, use the CSV to JSON converter instead — it parses the format properly rather than splitting on a character.

Questions

Does it handle quoted CSV fields containing commas?
No. This splits on every comma, so a value like "Smith, John" would become two items. Use the CSV to JSON converter for files with quoted fields.
Is the space after each comma removed?
Yes. Each item is trimmed, so "a, b, c" gives three clean values with no leading spaces.

Build your own chain in the pipeline builder.