Write rows
sheet_writeWrite rows to Excel (XLSX), CSV, TSV, or JSON files by creating a new file, appending, or overwriting existing data. Returns file details like row and column counts, byte size, and column names.
Instructions
Call this tool to write rows to an excel (xlsx) or csv/tsv/json file. Returns the rows, columns, byte size and column names of the file written.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | new_file writes a brand new file and refuses to clobber an existing one; append adds the rows under the existing data; overwrite replaces the file contents | |
| path | Yes | Source file for append/overwrite, or the intended file for new_file (~ is expanded) | |
| rows | Yes | Array of objects, whose keys become the headers, or an array of arrays with the header row first | |
| sheet | No | Sheet to write; default is the first sheet of the source, or "Sheet1" for a new file. Other sheets of an existing workbook are kept unchanged | |
| out_path | No | Where to write; default is a new file next to the source for new_file, or the source itself for append/overwrite. The output format follows this extension: .xlsx, .csv, .tsv or .json. An extension is required |