Update util.py
Browse files
util.py
CHANGED
|
@@ -40,7 +40,7 @@ def read_docx(file_path):
|
|
| 40 |
if block.tag.endswith("p"):
|
| 41 |
for paragraph in doc.paragraphs:
|
| 42 |
if paragraph._element == block and paragraph.text:
|
| 43 |
-
text.append(paragraph.text)
|
| 44 |
elif block.tag.endswith("tbl"):
|
| 45 |
for table in doc.tables:
|
| 46 |
if table._element == block:
|
|
@@ -50,9 +50,9 @@ def read_docx(file_path):
|
|
| 50 |
for cell in row.cells:
|
| 51 |
row_text.append(cell.text.strip())
|
| 52 |
|
| 53 |
-
text.append(" | ".join(row_text))
|
| 54 |
|
| 55 |
-
return "\n
|
| 56 |
|
| 57 |
def read_pptx(file_path):
|
| 58 |
prs = Presentation(file_path)
|
|
|
|
| 40 |
if block.tag.endswith("p"):
|
| 41 |
for paragraph in doc.paragraphs:
|
| 42 |
if paragraph._element == block and paragraph.text:
|
| 43 |
+
text.append(paragraph.text + "\n")
|
| 44 |
elif block.tag.endswith("tbl"):
|
| 45 |
for table in doc.tables:
|
| 46 |
if table._element == block:
|
|
|
|
| 50 |
for cell in row.cells:
|
| 51 |
row_text.append(cell.text.strip())
|
| 52 |
|
| 53 |
+
text.append(" | ".join(row_text) + "\n")
|
| 54 |
|
| 55 |
+
return "\n".join(text)
|
| 56 |
|
| 57 |
def read_pptx(file_path):
|
| 58 |
prs = Presentation(file_path)
|