feat: 跳过没有ID的行
This commit is contained in:
@@ -83,6 +83,10 @@ namespace ExcelTool
|
||||
IRow row = sheet.GetRow(i);
|
||||
if (row == null) continue;
|
||||
|
||||
|
||||
// ID为空则跳过该行
|
||||
if (string.IsNullOrEmpty(GetCellValue(row.GetCell(0)))) continue;
|
||||
|
||||
TableExcelRow tableExcelRow = new();
|
||||
for (int j = 0; j < headers.Count; j++)
|
||||
tableExcelRow.Add(GetCellValue(row.GetCell(j)));
|
||||
|
||||
@@ -120,6 +120,8 @@ namespace ExcelTool.Parser
|
||||
if (string.IsNullOrEmpty(row.StrList[idIndex])) continue;
|
||||
|
||||
uint id = Convert.ToUInt32(row.StrList[idIndex]);
|
||||
if (id == 0) continue; // 跳过ID=0的行
|
||||
|
||||
string rawNames = row.StrList[namesIndex];
|
||||
List<string> names = new(rawNames.Split(['|'], StringSplitOptions.RemoveEmptyEntries));
|
||||
|
||||
@@ -224,6 +226,8 @@ namespace ExcelTool.Parser
|
||||
if (string.IsNullOrEmpty(row.StrList[idIndex])) continue;
|
||||
|
||||
uint id = Convert.ToUInt32(row.StrList[idIndex]);
|
||||
if (id == 0) continue; // 跳过ID=0的行
|
||||
|
||||
string rawNames = row.StrList[namesIndex];
|
||||
List<string> names = new(rawNames.Split(['|'], StringSplitOptions.RemoveEmptyEntries));
|
||||
|
||||
|
||||
@@ -203,6 +203,7 @@ namespace ExcelTool.Parser
|
||||
if (string.IsNullOrEmpty(row.StrList[idIndex])) continue;
|
||||
|
||||
uint id = Convert.ToUInt32(row.StrList[idIndex]);
|
||||
if (id == 0) continue; // 跳过ID=0的行
|
||||
|
||||
// Names 是用分隔符(例如 '|')拼接的字符串
|
||||
string rawNames = row.StrList[namesIndex];
|
||||
|
||||
Reference in New Issue
Block a user