excel
简介
一个用于对excel文件读写的库 (Import xlnt library)
组件接口
excel.gs
| 函数原型 | 函数作用 |
|---|---|
| object open(string path, string mode = "rw") | 以指定模式打开excel文件, 使用"w"选项时,若文件不存在则会进行创建,默认表(sheet)编号为0 |
| object open_from_data(string path, string mode, buffer data) | 使用缓冲区中的数据创建新文件 |
| mixed read_all(string path, buffer data = nil, int sheet = 0, bool is_to_str = false) | 读取指定文件或缓冲区中的指定表格 |
| mixed read_all_by_sheets(string path, buffer data = nil, mixed sheet_info = nil, bool is_to_str = false) | 读取指定文件或缓冲区中的指定表格 |
| mixed write_all(string path, array arr, int sheet = 0) | 将表格数据写入指定文件的指定的单个表格中,覆盖式写入 |
| mixed write_all_by_sheets(string path, array sheets_content, array sheet_num) | 将表格数据写入指定文件的指定的多个表格中,将sheets_content[i]中的数组数据写入sheet_num[i]表格中,覆盖式写入 |
workbook.gs
支持对已经打开的excecl文档的操作
枚举
CellValueType
NIL = 0,
INTEGER = 1,
BOOLEAN = 2,
REAL = 3,
STRING = 4,
ExcelFontAttribute
FONT_ATTRIBS = 0,
FONT_SIZE = 1,
FONT_BOLD = 2,
FONT_COLOR = 3,
FONT_ITALIC = 4,
FONT_STRIKEOUT = 5,
FONT_UNDERLINE = 6