xlsx — Excel workbooks — openbash
Read and edit an Excel workbook the way Excel does: values and formulas, rows, columns and sheets inserted and deleted with every reference following, formats, names, pivots, and every formula recalculated on save.
xlsx
xlsx is a command on the openbash shell, reachable over HTTP, SSH and MCP with one key. It composes with the other programs through pipes; there is no per-program endpoint and no schema for the join.
xlsx /tmp/draft.xlsx set "'Rent Builder'!H12" 2450 'Rent Builder'!H12 = 2450 recalculated 33367 formulas (iterating, as the file asks) saved /tmp/draft.xlsx"
help
xlsx FILE COMMAND [ARGS] [+ COMMAND [ARGS]]...
Read and edit a spreadsheet the way Excel does. Cells are named as Excel names
them: B9, B9:D20, Costs!B9, 'Rent Builder'!AF12, whole columns B:D, rows 3:5.
An address without a sheet means --sheet, or the first sheet.
READ (prints, changes nothing; also reads .xls .xlsb .ods)
sheets [--names] every sheet: name, used range, formulas, state;
--names prints the names alone, one per line
structure each sheet's heading rows, row-label column and
columns: what --keep-structure holds still
get RANGE [--as csv|tsv|json|formulas] cells (json carries value + formula);
a sheet's name alone is its used range
find TEXT cells whose value or formula contains TEXT
errors cells holding #DIV/0!, #N/A, #REF!, …
deps CELL what CELL's formula reads
trace CELL the formulas that read CELL
calc 'EXPR' [--iterate] work out a formula against the book, unsaved
names defined names and what they refer to
pivots pivot tables: where, source, fields
WRITE (edits FILE in place, recalculates, saves once per chain)
set CELL VALUE [CELL VALUE]... =FORMULA, number, 7.5%, TRUE, 'text, text
clear RANGE empty the cells, keep their formats
fill RANGE VALUE one formula across a range, as drag-fill does
copy RANGE TO_CELL values, formulas (translated) and formats
insert-rows SHEET ROW [N] N rows before ROW; every reference follows
delete-rows SHEET ROW[:ROW] references into them become #REF!
insert-cols SHEET COL [N] N columns before COL (a letter)
delete-cols SHEET COL[:COL]
add-sheet NAME [--after SHEET] rename-sheet OLD NEW delete-sheet NAME
copy-sheet SHEET NEW
name NAME =REFERENCE unname NAME
fmt RANGE SPEC... numfmt='"$"#,##0' bold italic underline
color=RRGGBB fill=RRGGBB|none border=thin|none
align=left|center|right wrap size=11
width SHEET COL[:COL] WIDTH height SHEET ROW[:ROW] HEIGHT
recalc recalculate only
new [SHEET] make FILE a new empty workbook
OPTIONS -o OUT write to OUT instead of FILE --sheet S home sheet
--no-recalc save without recalculating (cached values go stale)
--keep-structure change data only: cells, and rows added or deleted.
Headings (column labels), existing rows' labels, columns,
sheets and names are refused, and the chain saves nothing.
`structure` shows what is held; when it guessed wrong:
--header-rows 'SHEET'!1:8 --label-cols 'SHEET'!A ('SHEET'!- = none)
Every save recalculates. A formula this engine cannot work out keeps the value
the file had, is listed, and Excel recalculates it on open — never a silent 0.