apply_changes
Write modified data back to Excel/CSV files while preserving original formatting. Accepts JSON data from parse_sheet, supports adding, deleting, and updating rows and cells, and creates backups by default to prevent data loss.
Instructions
将修改后的数据写回Excel/CSV文件,完成数据编辑闭环。接受parse_sheet返回的JSON格式数据(修改后)。保留原文件格式和样式,默认创建备份文件防止数据丢失。支持添加、删除、修改行和单元格数据。
Input Schema
Name | Required | Description | Default |
---|---|---|---|
create_backup | No | 【可选】是否在写入前创建原始文件的备份。默认为 `true`,以防意外覆盖。 | |
file_path | Yes | 需要写回数据的目标文件的绝对路径。 | |
table_model_json | Yes | 从 `parse_sheet` 工具获取并修改后的 TableModel JSON 数据。 |
Input Schema (JSON Schema)
{
"properties": {
"create_backup": {
"description": "【可选】是否在写入前创建原始文件的备份。默认为 `true`,以防意外覆盖。",
"type": "boolean"
},
"file_path": {
"description": "需要写回数据的目标文件的绝对路径。",
"type": "string"
},
"table_model_json": {
"description": "从 `parse_sheet` 工具获取并修改后的 TableModel JSON 数据。",
"properties": {
"headers": {
"items": {
"type": "string"
},
"type": "array"
},
"rows": {
"items": {
"items": {},
"type": "array"
},
"type": "array"
},
"sheet_name": {
"type": "string"
}
},
"required": [
"sheet_name",
"headers",
"rows"
],
"type": "object"
}
},
"required": [
"file_path",
"table_model_json"
],
"type": "object"
}