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 --导出到目标文件