diff --git a/ena_upload/ena_upload.py b/ena_upload/ena_upload.py index 556b1b6..53bf46c 100755 --- a/ena_upload/ena_upload.py +++ b/ena_upload/ena_upload.py @@ -804,7 +804,12 @@ def main(): schema_tables = {} for schema in SCHEMA_TYPES: - xl_sheet = xl_workbook.parse(schema, header=0) + if schema in xl_workbook.book.sheetnames: + xl_sheet = xl_workbook.parse(schema, header=0) + elif f"ENA_{schema}" in xl_workbook.book.sheetnames: + xl_sheet = xl_workbook.parse(f"ENA_{schema}", header=0) + else: + sys.exit(f"The sheet '{schema}' is not present in the excel sheet {xlsx}") xl_sheet = xl_sheet.drop(0).dropna(how='all') for column_name in list(xl_sheet.columns.values): if 'date' in column_name: