tsvsheet logo tsvsheet

Google Sheets

Google Sheets exports any tab as TSV over a plain URL, and tsvsheet's import functions drink it directly — while Sheets' IMPORTDATA pulls rendered tsvsheet output the other way. Two spreadsheets, one wire format, both directions live.

Import a Google Sheet into the grid

The import* functions accept plain text/tab-separated-values and text/csv alongside their own media types — and a Google Sheets export URL serves exactly that. So a cell can hold a whole Google Sheet: substitute the SHEET_ID from a link-shared sheet’s address bar (and a gid for a specific tab):

printf '=importsheet("https://docs.google.com/spreadsheets/d/SHEET_ID/export?format=tsv&gid=0")\n' > pulled.tsvt
tsv render --allow-import --import-host docs.google.com pulled.tsvt

Imports are off by default: the operator enables them with --allow-import and must allowlist each host — nothing inside a .tsvt can turn them on. What arrives is computed values only (a leading = stays literal text), fetches are cached across recomputes, and any failure shows as #IMPORT! in the cell — tsv explain A1 pulled.tsvt tells you why. If the export redirects to a googleusercontent.com host, allowlist that too: --import-host "*.googleusercontent.com".

importrange works the same but spills the grid into the sheet around it, so imported rows sit next to your own =formulas.

The clipboard, again

Everything on the Excel page about clipboards applies here unchanged: copy a range in Google Sheets and the clipboard holds tab-separated values (pbpaste > sheet.tsvt); render a sheet with tsv render | pbcopy and paste it into Sheets as a grid.

Or snapshot it with curl

When you want a one-shot copy rather than a live import, the same export URL pipes anywhere:

curl -fsSL "https://docs.google.com/spreadsheets/d/SHEET_ID/export?format=tsv&gid=0" > pulled.tsvt
tsv check pulled.tsvt

The snapshot is immediately a valid .tsvt — add =formulas where you want live computation, or query it straight away with the SQLite and DuckDB recipes.

Feed a Google Sheet from a pipeline

The other direction uses Sheets’ own IMPORTDATA function, which reads CSV or TSV from any public URL. Publish a rendered sheet wherever you serve files — a GitHub raw URL, an S3 bucket, your CI artifacts:

tsv render report.tsvt > report.tsv    # publish this file at a URL

Then in any Google Sheets cell:

=IMPORTDATA("https://example.com/report.tsv")

Sheets re-fetches periodically, so a .tsvt computed in CI becomes a live, always-current range inside a shared Google Sheet — the plain-text sheet stays the source of truth, versioned in git; the Google Sheet is just a window onto it.