| 183 | |
| 184 | class XLSXReader(Reader): |
| 185 | def parse(self, file_path: Path) -> str: |
| 186 | logger.info(f"Reading XLSX file from {file_path}.") |
| 187 | workbook = openpyxl.load_workbook(file_path, data_only=True) |
| 188 | text = "" |
| 189 | |
| 190 | for sheet in workbook: |
| 191 | text += f"\nSheet: {sheet.title}\n" |
| 192 | for row in sheet.iter_rows(values_only=True): |
| 193 | row_data = [str(cell) if cell is not None else "" for cell in row] |
| 194 | text += "\t".join(row_data) + "\n" |
| 195 | |
| 196 | return text |
| 197 | |
| 198 | class ZipReader(Reader): |
| 199 | def parse(self, file_path: Path) -> str: |