Extract or edit a structural selection from xlsx, docx, pdf, or pptx into a new derived file; the source file is never modified.
Tasks
Extract a worksheet range like Sheet1!A1:C10 from an xlsx file into a new csv, md, or xlsx file
Apply cell-value edits to an xlsx via patch-copy, producing a derived copy such as report-updated.xlsx
Replace a whole body paragraph in a docx using a replacements edit with expectText as a hard gate
Extract pages or character ranges from a pdf into txt, md, or a pdf page copy
Extract slide, shape, paragraph, or table-cell text from a pptx into txt or md
Generate a fresh workbook, deck, or document by writing short openpyxl/python-docx/python-pptx programs run with uv run --with
Inputs
Absolute path to a source file in xlsx, docx, pdf, or pptx format (--file)
An anchor JSON object selecting the region: xlsx sheet+range, docx paragraph/paraId/charRange, pdf page+charRange, or pptx slide/nodeId/paragraph/tableCell
An absolute output path (--out) whose extension determines the extracted format
Edits JSON for patch-copy (xlsx cells map or docx replacements list)
An optional selection-ref block from a chat surface containing path, anchor, excerpt, and fileStamp
Outputs
A new derived file named after the source with an operation suffix (e.g. report-updated.xlsx, report-q1-range.csv, spec-p3.txt)
The written output path printed by the script on success
xlsx extraction can produce xlsx, csv, or md; docx extraction docx, txt, or md; pdf extraction pdf (page copy), txt, or md; pptx extraction txt or md
Limitations and checks
The source file is read-only; both scripts refuse to write to the source path or overwrite an existing file
xlsx extraction reads computed values (data_only), so formula cells yield their last saved result
docx extraction to docx carries text only, not run styling
Patch-copy does not recalculate; a formula reading an edited cell keeps its last cached value (fullCalcOnLoad is set so Excel recomputes on open)
xlsx cells in a shared, array, or data-table formula group are refused; coordinates outside the worksheet grid are refused
docx paragraphs holding content outside the allow-list shape (bookmarks, images, hyperlinks, tracked changes, fields, page/column breaks, etc.) are refused; docx paragraph text cannot contain tab, newline, or carriage return
Control characters other than tab, newline, and carriage return are refused in written text
pptx edits go through python-pptx, not patch-copy; slide-copy into a new deck is not supported
Search
Find projects, verify facts, compare options, and filter by your requirements
Try a searchA click only fills the search box; you stay in control