CSV and TSV as a table

.csv/.tsv files open as a table on the blob page (src/web/render/csv.ts, parser in csv-parse.ts). RFC 4180 with quotes, embedded newlines, doubled quotes and a BOM; the delimiter (, ; tab |) is detected from the first record. The first 1,000 rows are drawn on the server with a sticky header and (on phones) a sticky first column; numeric columns are right-aligned. ?all=1 ("Show all N rows", no JavaScript needed) draws up to 20,000. The header line shows rows × columns and the delimiter. A small script adds a filter box over the rows drawn; no library. A file that is not valid CSV shows the source with a one-line reason. ?view=source, Raw and Download work as for any file.

Sorting

A column header is a link: ?sort=<column>&dir=asc|desc on the blob page, so a sorted table has an address and works without JavaScript. Clicking a header sorts ascending; clicking the sorted header flips it. The sorted header shows an arrow and aria-sort.

In the terminal, on a .csv/.tsv open in the workspace, o orders the rows: file order, then each column ascending and descending in turn (the header shows ▲/▼), then file order again. It uses the page's sortRows (src/text/csv-sort.ts); s still flips to the source, which is never reordered.

JSON Lines

.jsonl/.ndjson files use the same table (src/web/render/jsonl-parse.ts makes the rows; csv.ts draws them).

Files over 5 MB

A table file over the render cap is not refused: a reader that draws (the page, the terminal workspace) asks the source for a prefix (blob(ref, path, { prefix: true })); the source reads its first bytes (CSV_PREFIX_BYTES) cut at a whole line and marks the blob partial. Only a partial blob lifts the table's RENDER_CAP; an editor or any other reader asks for no prefix and gets too_large as before, so a cut file is never saved.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs