mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-03 07:11:56 +00:00
new: added ExcelParser(tested) to read .xlsx files
This commit is contained in:
1 parent
7794129929
commit
e9a7722915
1 file changed
-25
@@ -1,25 +0,0 @@
|
||||
from pathlib import Path
|
||||
from application.parser.file.tabular_parser import ExcelParser,PandasCSVParser
|
||||
|
||||
# Define the path to the .xlsx file
|
||||
file_path = Path("/home/dev523/DocsGPT/Ledgers in Default Template.xlsx")
|
||||
parser = ExcelParser(concat_rows=True, pandas_config={})
|
||||
|
||||
# Initialize the ExcelParser
|
||||
# file_path = Path("/home/dev523/DocsGPT/mlb_teams_2012.csv")
|
||||
# parser = PandasCSVParser(concat_rows=True, pandas_config={})
|
||||
|
||||
|
||||
|
||||
# Initialize the parser configuration (this can be customized if needed)
|
||||
parser.init_parser()
|
||||
|
||||
# Check if the parser config is set (this is optional)
|
||||
if parser.parser_config_set:
|
||||
print("Parser config has been set.")
|
||||
|
||||
# Parse the Excel file
|
||||
parsed_data = parser.parse_file(file_path)
|
||||
print(parsed_data)
|
||||
|
||||
|
||||
Reference in new issue
Block a user