cat / 012
clone

a spreadsheet for the terminal: lotus 1-2-3 looks, google sheets keys and formulas, one go binary

cat/module-path
012 / internal / sheet / testdata / fixtures / new / workbook.012
workbook.012 8.7K
1{2 "version": 7,3 "names": {"Units": "Sales!C2:C9", "Lost": "#REF!", "Rate": "Lists!B1"},4 "macroOrigin": "fixture-machine",5 "macros": [6 {"name": "Bold header", "key": "1", "api": 1, "source": "select(\"A1:E1\")\nrun(\"format.bold\")\n"},7 {"name": "Fill totals", "api": 1, "source": "set(\"F2\", \"=SUM(C2:C9)\")\n"}8 ],9 "shellHistory": ["ls", "open data.csv | first 3"],10 "active": 0,11 "sheets": [12 {13 "name": "Sales",14 "widths": {"A": 12, "B": 10, "E": 14},15 "heights": {"1": 2, "12": 3},16 "lines": {"A:XFD": {"italic": true}, "D:D": {"format": "currency", "decimals": 2}, "1:1": {"bold": true, "align": "center", "borders": {"bottom": "double"}}},17 "freeze": {"rows": 1, "cols": 1},18 "filter": {"range": "A1:E9", "columns": {"B": {"hidden": ["West"]}, "C": {"condition": "gt", "value": "2"}}},19 "protected": [{"range": "E2:E9", "description": "Totals"}],20 "merges": ["A11:C11", "A12:A13"],21 "cells": {22 "A1": "Date",23 "B1": "Region",24 "C1": "Units",25 "D1": "Price",26 "E1": "Total",27 "A2": {"input": "2026-01-05", "format": "date"},28 "B2": "North",29 "C2": "3",30 "D2": "12.5",31 "E2": {"input": "=C2*D2", "format": "currency", "decimals": 2, "own": true},32 "A3": {"input": "2026-01-12", "format": "date"},33 "B3": {"input": "South", "note": "Includes returns"},34 "C3": "5",35 "D3": "9.75",36 "E3": "=C3*D3",37 "A4": {"input": "2026-02-02", "format": "date"},38 "B4": "West",39 "C4": "1",40 "D4": "40",41 "E4": "=C4*D4",42 "A5": {"input": "2026-02-16", "format": "date"},43 "B5": "North",44 "C5": "7",45 "D5": "12.5",46 "E5": "=C5*D5",47 "A6": {"input": "2026-03-01", "format": "date"},48 "B6": "East",49 "C6": {"input": "2", "bold": true, "italic": true, "underline": true, "strikethrough": true},50 "D6": "22",51 "E6": "=C6*D6",52 "A7": {"input": "2026-03-09", "format": "date"},53 "B7": "South",54 "C7": {"input": "4", "align": "left", "valign": "top"},55 "D7": "9.75",56 "E7": "=C7*D7",57 "A8": {"input": "2026-03-20", "format": "date"},58 "B8": "East",59 "C8": {"input": "6", "borders": {"top": "thin", "bottom": "double", "left": "thick", "right": "thin", "bottomColor": "red", "leftColor": "blue"}},60 "D8": "22",61 "E8": "=C8*D8",62 "A9": {"input": "2026-03-31", "format": "date"},63 "B9": "West",64 "C9": "8",65 "D9": "40",66 "E9": "=C9*D9",67 "G1": "Share",68 "G2": {"input": "=C2/SUM(Units)", "format": "percent", "decimals": 1},69 "G3": {"input": "=C3/SUM(Units)", "format": "custom", "pattern": "0.00%;[Red]-0.00%"},70 "H1": "Regions",71 "H2": "=SORT(UNIQUE(B2:B9))",72 "I1": "Scaled",73 "I2": "=LET(r, Rate, MAP(C2:C4, LAMBDA(x, x*r)))",74 "J1": {"input": "007", "text": true},75 "J2": {"input": "=1+1", "text": false, "format": "text"},76 "A11": {"input": "A long title merged across three columns", "wrap": "wrap", "align": "center"},77 "A12": {"input": "Tall", "valign": "middle"},78 "B12": {"input": "clipped text that does not spill over", "wrap": "clip"},79 "C12": "TRUE",80 "D12": "=IFERROR(1/0, \"none\")",81 "E12": {"input": "=Lists!B1*2", "format": "number", "decimals": 3},82 "F12": "'00123",83 "F13": "=HYPERLINK(\"https://example.com\", \"site\")"84 },85 "charts": [86 {"type":"column","data":"A1:C9","at":"K2","width":40,"height":12,"header":true,"labels":true,"title":"Units by date"},87 {"type":"line","data":"C1:E9","at":"K16","width":36,"height":10,"header":true,"stack":"stacked","trend":true,"min":0,"max":400,"gridlines":false,"legend":"none"},88 {"type":"pie","data":"B1:C5","at":"K28","width":30,"height":10,"header":true,"labels":true,"legend":"right"},89 {"type":"scatter","data":"C1:D9","at":"K40","width":30,"height":10,"header":true,"trend":true,"log":true},90 {"type":"bar","data":"B1:C9","at":"K52","width":30,"height":10,"header":true,"stack":"percent"},91 {"type":"area","data":"C1:D9","at":"K64","width":30,"height":10,"byRow":true,"header":true}92 ],93 "conditionalFormats": [94 {"ranges":"C2:C9","condition":"gt","values":["5"],"text":"red","bold":true},95 {"ranges":"B2:B9","condition":"contains","values":["th"],"fill":"yellow","italic":true},96 {"ranges":"A2:A9","condition":"date_is","values":["this week"],"underline":true},97 {"ranges":"E2:E9","condition":"formula","values":["=$C2>4"],"text":"green","strikethrough":true},98 {"ranges":"C2:C9","condition":"between","values":["2","4"],"fill":"cyan"},99 {"ranges":"C2:C9","condition":"top","values":["3"],"fill":"magenta"},100 {"ranges":"D2:D9","condition":"duplicate","text":"blue"},101 {"ranges":"C2:C9","condition":"above_average","bold":true},102 {"ranges":"D2:D9","scale":[{"type":"min","color":"green"},{"type":"percentile","value":"50","color":"yellow"},{"type":"max","color":"red"}]},103 {"ranges":"E2:E9","dataBar":{"color":"blue","min":{"type":"min"},"max":{"type":"num","value":"400"},"barOnly":true}},104 {"ranges":"C2:C9,D2:D9","iconSet":{"icons":"arrows","points":[{"type":"percent","value":"33"},{"type":"percent","value":"67"}],"reverse":true}}105 ],106 "validations": [107 {"ranges":"B2:B9","criteria":"list","items":["North","South","East","West"],"help":"Pick a region","display":"chip"},108 {"ranges":"C2:C9","criteria":"number","condition":"between","values":["0","80"],"reject":true},109 {"ranges":"A2:A9","criteria":"date","condition":"gt","values":["2025-12-31"]},110 {"ranges":"C12","criteria":"checkbox","items":["TRUE","FALSE"]},111 {"ranges":"F2:F9","criteria":"range","source":"Lists!A1:A4","display":"plain"},112 {"ranges":"G5:G9","criteria":"length","condition":"le","values":["10"]},113 {"ranges":"H12","criteria":"formula","values":["=H12<>\"\""]}114 ]115 },116 {117 "name": "Lists",118 "hidden": true,119 "protected": [{"sheet": true}],120 "tables": [{"name":"Targets","range":"D1:E3","columns":["Region","Target"],"banded":true,"header":true}],121 "cells": {122 "A1": "North",123 "A2": "South",124 "A3": "East",125 "A4": "West",126 "B1": {"input": "1.5", "note": "Rate used by Sales!I2"},127 "D1": "Region",128 "E1": "Target",129 "D2": "North",130 "E2": "20",131 "D3": "South",132 "E3": "=E2/2",133 "F1": "=SUM(Targets[Target])+ROWS(Targets[#All])",134 "F2": "=Targets[@Target]*2",135 "F3": "=COUNTA(Targets[[#Headers],[Region]:[Target]])"136 }137 },138 {139 "name": "Pivot Table 1",140 "cells": {},141 "pivot": {"source":"Sales!A1:E9","rows":[{"column":"B"},{"column":"A","order":"desc","sortBy":1}],"columns":[{"column":"C"}],"values":[{"column":"E","summarize":"sum"},{"column":"C","summarize":"counta","showAs":"percent_of_total","name":"Share"}],"filters":[{"column":"B","hidden":["West"]}],"rowTotals":true,"columnTotals":false}142 },143 {144 "name": "Data",145 "widths": {"A": 20},146 "cells": {147 "A20": "=SUM(nu.files)",148 "A21": "=SUM(trips[fare])",149 "A22": "=COUNTIFS(events[kind],\"click\",events[ms],\">100\")"150 },151 "regions": [152 {"name":"files","at":"A1","output":true},153 {"name":"big","at":"A8","output":true},154 {"name":"app","at":"F2","path":"logs/app.csv","window":500},155 {"name":"db","at":"F20","path":"data.sqlite","format":"SQLite","table":"orders"},156 {"name":"q","at":"M20","path":"data.sqlite","format":"SQLite","query":"select * from orders limit 5"}157 ]158 },159 {160 "name": "trips",161 "cells": {},162 "regions": [163 {"name":"trips","at":"A1","path":"trips.parquet","paged":true,"order":{"sort":[{"column":"C","desc":true}],"filter":[{"column":"B","condition":"eq","value":"card"},{"column":"D","condition":"gt","value":"10"}]}}164 ]165 },166 {167 "name": "events",168 "cells": {},169 "regions": [170 {"name":"events","at":"A1","path":"events.sqlite","format":"SQLite","query":"select * from events where day > 0","paged":true}171 ]172 },173 {174 "name": "Notebook",175 "cells": {},176 "tab": "notebook",177 "reactive": true,178 "notebookCells": [179 {"kind":"note","source":"# Files\nWhat the folder holds."},180 {"source":"files = ls","output":"[[name, size]; [go.mod, 812b], [README.md, 4kb]]"},181 {"source":"big = $files | where size > 1kb","output":"[[name, size]; [README.md, 4kb]]","note":"2 rows left out"},182 {"source":"$files | nope","error":"Command `nope` not found","detail":"help: check the spelling"},183 {"source":"ls **/*","unsaved":true}184 ]185 }186 ]187}