-
Notifications
You must be signed in to change notification settings - Fork 2.1k
excel row
goworm edited this page Jul 17, 2026
·
3 revisions
Address a worksheet row to set its height, hide it, group it into an outline, or query rows by a column predicate.
Path: /{SheetName}/row[N] (N is 1-based)
- add - Insert a row, optionally seeding empty cells or cloning from another row
- set - Change row height, visibility, or outline grouping
- get - Read a row's attributes
- query - Filter rows by a column predicate (e.g.
row[Salary>5000]) - remove - Delete a row
Parent: /{SheetName}
| Property | Default | Description |
|---|---|---|
cols |
Number of empty cells to seed in the new row | |
height |
Row height in points | |
hidden |
false |
Hide the row |
add --from /{SheetName}/row[K] with --before/--after clones cells + single-row mergeCells; relative formula refs are delta-shifted to the new anchor (Excel "Insert Copied Cells" parity). Inserting at an occupied slot shifts every row at or past the slot down by one, and every range-bearing structure on the sheet (mergeCells, CF/DV sqref, autoFilter, hyperlink/table refs, named ranges, formula cell-refs) follows the displacement.
Path: /{SheetName}/row[N]
| Property | Description |
|---|---|
height |
Row height in points |
hidden |
Hide/show the row |
outline |
Outline/group level 0-7. Aliases: outlineLevel, group. Get readback uses canonical key outlineLevel
|
collapsed |
Collapse the row group. Readable too (v1.0.136+ schema-doc fix — Get always supported it; the schema just under-claimed set-only) — omitted from Get when not collapsed. |
| (table column name or bare column letter) | (v1.0.133+) Any other key is resolved as a table column: set /Sheet1/row[2] --prop Salary=9000 writes the underlying data cell (e.g. C2) when row 2 falls inside a table's data span and Salary is one of its column headers. Header and totals rows never resolve this way. An unrecognized key is rejected with the table's real column names (no such column; available: Name, Salary) rather than being silently written as a phantom row attribute. |
All formatting props are currently Set-only (Add/Set asymmetry).
| Attribute | Type | Description |
|---|---|---|
height |
number | Row height in points (raw double as stored) |
hidden |
bool |
true when hidden, key absent otherwise |
outlineLevel |
number | Outline grouping level (0 = ungrouped, 1..7 = nested depth). Get-only readback of the value set via outline; key omitted when the row has no outline level |
customHeight |
bool |
true when the row carries an explicit height (Row @customHeight) |
matchedTable |
string | Label of the table whose column predicate this row matched (emitted on row nodes returned by a row[Col op val] selector). Get-only |
collapsed |
bool |
true when the row's outline group is collapsed, omitted otherwise |
tableSource |
string |
detected when matchedTable came from a header-sniffed (not real listObject) table. Get-only |
# Set row height and hide a row
officecli set data.xlsx /Sheet1/row[2] --prop height=24
officecli set data.xlsx /Sheet1/row[5] --prop hidden=true
# Group rows into an outline level, then collapse
officecli set data.xlsx /Sheet1/row[3] --prop outline=1
officecli set data.xlsx /Sheet1/row[3] --prop collapsed=true
# Write a table cell by column name via row-set (v1.0.133+)
officecli set data.xlsx /Sheet1/row[2] --prop Salary=9000
# Insert a new row seeded with 5 empty cells
officecli add data.xlsx /Sheet1 --type row --prop cols=5
# Clone a row's cells and formatting below the original
officecli add data.xlsx /Sheet1/row[2] --from /Sheet1/row[2] --after
# Read a row's attributes
officecli get data.xlsx /Sheet1/row[2]
# Filter rows by a column predicate (resolves against a ListObject or a detected header-row table)
officecli query data.xlsx "row[Salary>5000]"
officecli query data.xlsx "row[Region=West and Sales>1000]"
officecli query data.xlsx "row[Status=open or Priority=high]"
# Remove a row
officecli remove data.xlsx /Sheet1/row[5]- Sheet - The parent worksheet
- Cell - Individual cells within a row
- Row Break - Manual horizontal page breaks
- Excel Reference - All Excel elements
Based on OfficeCLI v1.0.137