Skip to content

Conversation

@ollietulloch
Copy link
Contributor

Logic already exists to attempt to load an xlsx_file_with_xls_extension.xls, i.e. it's an excel file with the wrong excel extension.

This PR allows the NdrImport::File::Excel handler to load excel workbooks that have the incorrect file extension, for example .dat files received via Mesh. It creates a copy of the file with an updated file extension, taken from the NdrImport::Table.format. If the format provided still doesn't work, the workbook will fail to load in the usual way.

If the NdrImport::Table.format is an excel format, we do not create a new file. This causes a loop in the existing logic.

Files created are deleted once the workbook has either loaded, or failed to load.

Also included is some light refactoring/boyscouting of the load_workbook method, to appease rubocop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant