feat: 跳过没有ID的行

This commit is contained in:
2026-05-19 12:20:42 +08:00
parent b0afff73ac
commit 493ecfeb11
3 changed files with 12 additions and 3 deletions
+4
View File
@@ -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)));
+4
View File
@@ -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));
+1
View File
@@ -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];