convert_to_html
Convert Excel/CSV files to HTML for browser viewing while preserving original styles, colors, and fonts. Supports multi-sheet selection, pagination for large files, and returns structured JSON with conversion details.
Instructions
将Excel/CSV文件转换为可在浏览器中查看的HTML文件。保留原始样式、颜色、字体等格式。支持多工作表文件,可选择特定工作表或转换全部。大文件可使用分页功能。返回结构化JSON,包含成功状态、生成的文件信息和转换摘要。
Input Schema
Name | Required | Description | Default |
---|---|---|---|
file_path | Yes | 源表格文件的绝对路径,支持 .csv, .xlsx, .xls, .xlsb, .xlsm 格式。 | |
header_rows | No | 【可选】将文件顶部的指定行数视为表头。默认为 1。 | |
output_path | No | 输出HTML文件的路径。如果留空,将在源文件目录中生成一个同名的 .html 文件。 | |
page_number | No | 【可选】要查看的页码,从1开始。默认为1。用于浏览大型文件的特定页面。 | |
page_size | No | 【可选】分页时每页显示的行数。默认为100行。用于控制大型文件转换后HTML的单页大小。 | |
sheet_name | No | 【可选】要转换的单个工作表的名称。如果留空,将转换文件中的所有工作表。 |
Input Schema (JSON Schema)
{
"properties": {
"file_path": {
"description": "源表格文件的绝对路径,支持 .csv, .xlsx, .xls, .xlsb, .xlsm 格式。",
"type": "string"
},
"header_rows": {
"description": "【可选】将文件顶部的指定行数视为表头。默认为 1。",
"type": "integer"
},
"output_path": {
"description": "输出HTML文件的路径。如果留空,将在源文件目录中生成一个同名的 .html 文件。",
"type": "string"
},
"page_number": {
"description": "【可选】要查看的页码,从1开始。默认为1。用于浏览大型文件的特定页面。",
"type": "integer"
},
"page_size": {
"description": "【可选】分页时每页显示的行数。默认为100行。用于控制大型文件转换后HTML的单页大小。",
"type": "integer"
},
"sheet_name": {
"description": "【可选】要转换的单个工作表的名称。如果留空,将转换文件中的所有工作表。",
"type": "string"
}
},
"required": [
"file_path"
],
"type": "object"
}