| 168 | |
| 169 | class ExcelReader(Reader): |
| 170 | def parse(self, file_path: Path) -> str: |
| 171 | logger.info(f"Reading Excel file from {file_path}.") |
| 172 | try: |
| 173 | excel_data = pd.read_excel(file_path, sheet_name=None) |
| 174 | |
| 175 | all_sheets_text = [] |
| 176 | for sheet_name, data in excel_data.items(): |
| 177 | all_sheets_text.append(f"Sheet Name: {sheet_name}\n{data.to_string()}\n") |
| 178 | |
| 179 | return "\n".join(all_sheets_text) |
| 180 | except Exception as e: |
| 181 | logger.info(f"Error reading Excel file: {e}") |
| 182 | return "Error reading Excel file." |
| 183 | |
| 184 | class XLSXReader(Reader): |
| 185 | def parse(self, file_path: Path) -> str: |