移除了print特定列
This commit is contained in:
parent
ab4d2da1cf
commit
d5fbd8d620
|
@ -8,23 +8,12 @@ def parse_excel(file_path):
|
||||||
blocks = []
|
blocks = []
|
||||||
|
|
||||||
for sheet_name, df in all_sheets.items():
|
for sheet_name, df in all_sheets.items():
|
||||||
df = df.fillna(method='ffill')#填充合并的单元格
|
df = df.fillna(method="ffill") # 填充合并的单元格
|
||||||
headers = df.columns.tolist()
|
headers = df.columns.tolist()
|
||||||
|
|
||||||
for _, row in df.iterrows():
|
for _, row in df.iterrows():
|
||||||
html_table = "<html><body><table><tr>{}</tr><tr>{}</tr></table></body></html>".format(
|
html_table = "<html><body><table><tr>{}</tr><tr>{}</tr></table></body></html>".format("".join(f"<td>{col}</td>" for col in headers), "".join(f"<td>{row[col]}</td>" for col in headers))
|
||||||
"".join(f"<td>{col}</td>" for col in headers),
|
block = {"type": "table", "img_path": "", "table_caption": [f"Sheet: {sheet_name}"], "table_footnote": [], "table_body": f"{html_table}", "page_idx": 0}
|
||||||
"".join(f"<td>{row[col]}</td>" for col in headers)
|
|
||||||
)
|
|
||||||
print(row['测试分类'])
|
|
||||||
block = {
|
|
||||||
"type": "table",
|
|
||||||
"img_path": "",
|
|
||||||
"table_caption": [f"Sheet: {sheet_name}"],
|
|
||||||
"table_footnote": [],
|
|
||||||
"table_body": f"{html_table}",
|
|
||||||
"page_idx": 0
|
|
||||||
}
|
|
||||||
blocks.append(block)
|
blocks.append(block)
|
||||||
|
|
||||||
return blocks
|
return blocks
|
||||||
|
|
Loading…
Reference in New Issue