解析脚本优化
This commit is contained in:
parent
b6b38d6075
commit
60a5ddf6d4
@ -65,7 +65,8 @@ for file_cfg in file_list:
|
||||
for row in rows:
|
||||
row_dict = {fieldnames[i]: row[i] for i in range(len(fieldnames))}
|
||||
index = row_dict.pop(file_cfg["key"]) # 获取第一列的值作为索引并移除第一列
|
||||
|
||||
if index == "" or index is None:
|
||||
continue # 跳过索引为空的行
|
||||
# 仅保留需要的字段
|
||||
fields_to_use = file_cfg.get("web_fields") if args.web and "web_fields" in file_cfg else file_cfg["fields"]
|
||||
row_dict = {field: row_dict[field] for field in fields_to_use if field in row_dict}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user