Browse the docs

Save rows to a file or the clipboard

Writes a list of rows as CSV, TSV, JSON, JSON Lines or a Markdown table, or puts them on the clipboard as a table.

Save rows to to

Details #

rows is a list of objects (such as {{ res.rows }} from Scrape a page into rows). The columns are the keys, in the order they first appear. The format follows the path's extension (.csv, .tsv, .json, .jsonl, .md) when format is left out.

append adds to the file instead of replacing it. With key it upserts: a row whose key column is already in the file replaces that row, so a nightly scrape grows one file without duplicates. New columns are added at the right.

to: clipboard puts tab-separated text on the clipboard, which pastes into Numbers or Excel as a table.

Parameters #

ParameterTypeRequiredValuesWhat it does
rowsany valueYesRequired.
totextYesA path (~ works), or clipboard. Required.
appendyes / no
formatone ofcsv tsv json jsonl markdown, append, key.
intotextThe variable that receives {path, count, added, updated}.
keytext
sampleany value

Every step also accepts label, onFailure, timeout and dryRunSafe.

Examples #

Put the selected table on the clipboard
Do
  1. Scrape “selection” into res
  2. Save rows to the clipboard
Open in Switchboard to try it

Gotchas #

  • Appending to a file in another format than its extension is refused.

  • Values that are lists or objects are written as JSON text in a CSV cell.