DSSAT / DSSAT/Florida_Crop_BMP_Datasets
Openxlsx2 reports files as unable to be opened
- Dominant language
- TeX
- Stars
- 3
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
When I opened a BMP template file using the QA/QC tool, I got:
> wb <- wb_load(file_path)
Error: xml import unsuccessful
The underlying problem is that the xml structure somehow was incorrect or became corrupted. This can arise from using non-Excel tools to manipulate files (such as openxlsx2 in R) or pasting data directly from PDFs.
Google AI suggests using this code:
wb <- tryCatch({
wb_load(file_path)
}, error = function(e) {
stop(paste("Error loading file: The Excel file may be corrupted by PDF formatting or other manipulations.",
"Please open the file, 'Save As' a new version, and try again. Saving as the older 'xls' format and then reopening as 'xlsx' may also help.""))
})
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in the QA/QC tool at the wb_load(file_path) call and reproduce the XML import error with the BMP template file. Trace how the failure is reported; done means the tool gives a clear recovery message when the workbook XML cannot be loaded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100