-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in detectDates = TRUE #249
Comments
I can't reproduce the error you are seeing. As a work around you can try
I'll continue looking into this. |
Hi Alex, Regards |
Confirming error exists as of July 2020 in version 4.1.5 |
I confirm having the same error. Here's how to reproduce it:
|
Loading the workbook first and then passing the workbook to read.xlsx somewhat resolves this error. (A warning message is received instead, but the read happens and valid dates appear to be read in). For what it's worth I discovered this in the course of tracking down another issue with a script taking nearly 3 minutes to read-in a 200line Excel sheet -- evidently the sheet author had highlighted a number of full-length columns with a background color and (I presume, a guess) read.xlsx was reading in the million+ max rows in the sheet, even though they were blank. In any case, loading the workbook first also resolved this issue. And the warning message received was: Will read the file and throw a warning: Will throw an error and fail to read when encountering certain date formats: |
i encountered a similar problem with openxlsx_4.2.3 running in R version 4.0.5 (2021-03-31) in Windows 10 when i use detect dates, i get the same
turning off detect dates, it reads in cleanly just noting this for you, i'm ok with not using detect dates. thanks for all of your work on this! |
I can confirm the issue is still there. See the file attached, opening it with
|
Hi Alex,
The detectDates argument is not able to read dates in dd/mm
dat.xlsx
/yyyy h:mm AM/PM format (e.g 23/08/2012 15:09:05). Hence when the argument is set to detectDates = TRUE when using read.xlsx in an excel file which has dates in the above format, I get the below error:
Error in read.xlsx.default(xlsxFile = "Customer Open Transaction Listing With Cut Off.xlsx", :
basic_string::substr: __pos (which is 8) > this->size() (which is 5)
This is new to 4.0.0. I've also tried on the development version as suggested in issue #242 but got the same error.
See the last column in the attached file. Without the column, the file loads successfully.
R version 3.3.2
Openxlsx version 4.0.0
Regards,
Joseph.
The text was updated successfully, but these errors were encountered: