mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: 修复导入csv空行没有过滤的问题
--bug=1047841 --user=刘瑞斌 【知识库】上传csv格式的表格模版,第一行标题导入后分段显示不全 https://www.tapd.cn/57709429/s/1597113
This commit is contained in:
parent
bb4db6571b
commit
76f63642e5
|
|
@ -28,6 +28,8 @@ class CsvSplitHandle(BaseParseTableHandle):
|
|||
# 第一行为标题
|
||||
title = csv_model[0].split(',')
|
||||
for row in csv_model[1:]:
|
||||
if not row:
|
||||
continue
|
||||
line = '; '.join([f'{key}:{value}' for key, value in zip(title, row.split(','))])
|
||||
paragraphs.append({'title': '', 'content': line})
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue