From 59cf5b3374cd33dc3da94eae161bc9263ac4987c Mon Sep 17 00:00:00 2001 From: xiyoo0812 Date: Tue, 23 Apr 2024 15:53:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A9=E5=B1=95=E5=AF=BC=E8=A1=A8=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/excel2lua/convertor.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/excel2lua/convertor.lua b/tools/excel2lua/convertor.lua index 6c433b80..63ac2ea4 100644 --- a/tools/excel2lua/convertor.lua +++ b/tools/excel2lua/convertor.lua @@ -301,17 +301,20 @@ end local function find_sheet_data_struct(sheet) local header = {} - local field_type = {} + local field_types = {} if not head_line then head_line = start_line - 1 end for col = sheet.first_col, sheet.last_col do -- 读取类型行,作为筛选条件 - field_type[col] = get_sheet_value(sheet, type_line, col) + local field_type = get_sheet_value(sheet, type_line, col) + if field_type and field_type ~= "" then + field_types[col] = get_sheet_value(sheet, type_line, col) + end -- 读取第四行作为表头 header[col] = get_sheet_value(sheet, head_line, col) end - return header, field_type + return header, field_types end --导出到目标文件