-
Notifications
You must be signed in to change notification settings - Fork 194
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
Failed to open a specific .xls: Unable to allocate memory #478
Comments
I'm unable to download the sheet you link to, so I can't tell what the problem is. If it is path related, then I predict b10a1a8 will have fixed it. If you can install the development version of readxl from GitHub and try again, please let me know what happens. |
Thank you for your answer. I tried with both devtools and cran versions and i obtain the same issue. But I tried to guess what is the problem with the file : It's a big file (100 Mo) with around 15 sheets. I've noticed that when I delete enough sheets (and the size is approximately 50 Mo) the function is working again. So I think it's a question of size of the xls file (bugging when the file is too big). But it is strange because I didn't have this issue with this same file with the last version of readxl I had on my computer (I cannot remember which one it was but I did not have the same issue before updating all my packages last week). |
Is it only this file that gives you problems? I finally succeeded with the download and also fail to read it with readxl. I get a more informative failure when I use a stand-alone tool built from libxls
I can ask over there if the maintainer is interested in acting on this, but yes it looks like the file size is part of the puzzle. |
I've tried readxl for the first time recently so I didn't try ot with a lot of files but yes it is the only example that I have in mind. And just for your information, this file is from the Insee (french national institute of statistics) and gives the age of the population for each french municipality. And yes I hope the maintainer will be interested in fixing this issue even if I can still use other packages dealing with xls file I'm interested in using this one ! Thanks |
FWIW @antuki, if the file is converted to xlsx with Microsoft Excel, it is readable by {readxl}. The issue is just for xls format. readxl::excel_sheets("~/../Downloads/pop-sexe-age-quinquennal6814/pop-sexe-age-quinquennal6814.xlsx")
#> [1] "Présentation" "Documentation"
#> [3] "Modifications_territoriales" "DEP_1968"
#> [5] "DEP_1975" "DEP_1982"
#> [7] "DEP_1990" "DEP_1999"
#> [9] "DEP_2009" "DEP_2014"
#> [11] "COM_1968" "COM_1975"
#> [13] "COM_1982" "COM_1990"
#> [15] "COM_1999" "COM_2009"
#> [17] "COM_2014"
readxl::read_excel("~/../Downloads/pop-sexe-age-quinquennal6814/pop-sexe-age-quinquennal6814.xlsx", sheet = paste0("COM_", 1975), skip = 12)[1:5, 1:5]
#> # A tibble: 5 x 5
#> `Région \r\nen gé~ `Département\r\n~ `Commune\r\nen g~ `Indicateur de s~
#> <chr> <chr> <chr> <chr>
#> 1 RR DR CR STABLE
#> 2 84 01 001 1
#> 3 84 01 002 1
#> 4 84 01 003 0
#> 5 84 01 004 1
#> # ... with 1 more variable: `Département\r\nen géographie 2016` <chr> Created on 2018-05-13 by the reprex package (v0.2.0). As this one won't change every often I think, it could be suitable for you to just download then convert manually before importing into R. However, the bugs remains with xls format. |
Hi, I am also having this issue with large xls files. I know that you mentioned that it seems to be a libxls issue; however, the bug seemed to occur after the update of R version 3.5.0 (2018-04-23) as I was able to read the same files previously. Hopefully that is useful information. Christian |
@cturnerbridger Is the xls in question available? |
The same as @cturnerbridger : i was also able to read this file with a previous version |
@antuki Is the xls in question available? The main mechanism for determining exactly what in these files triggers some new behaviour in libxls and, therefore, readxl, is for us to be able to examine the files in question. |
Yes it concerns the French xls file from the Insee. |
@jennybc sorry I can't share the files exactly. I will try to set up a similar / reproducible example today (UK time). Thanks for your help |
Hi, I have a similar problem (Ubuntu 16.04, R 3.4.4), here is the link to the file. Does not work with readxl versions 1.0.0 and 1.1.0. |
Same issue here with the file MYE6PE3_mid-2001-mid-2012-unformatted-syoa-data-file.xls that is part of the following Zip file: In previous version, I used to be able to do:
and now it no longer works... Best,
|
The |
Thank you @jennybc . I tried again with an "Insee" file today and the problem still remains. |
FWIW, same problem here with this file. Works with readxl 1.0, doesn't work with readxl 1.1. |
FWIW, @antuki, @joelgombin , I believe the libxls upstream has not been pulled yet into |
Having embedded the latest libxls in the dev version of readxl, I can read the original xls: readxl::read_excel(
"investigations/pop-sexe-age-quinquennal6814.xls",
sheet = paste0("COM_", 1975)
)
#> New names:
#> * `` -> `..2`
#> * `` -> `..3`
#> * `` -> `..4`
#> * `` -> `..5`
#> * `` -> `..6`
#> * … and 40 more
#> # A tibble: 38,227 x 46
#> `Recensement de… ..2 ..3 ..4 ..5 ..6 ..7 ..8 ..9 ..10
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 TABLEAU COMMUNA… <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
#> 2 France métropol… <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
#> 3 Découpage géogr… <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
#> 4 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
#> 5 Note de lecture… <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
#> 6 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
#> 7 Documentation <NA> Modi… <NA> <NA> <NA> <NA> <NA> <NA> <NA>
#> 8 © Insee Sour… <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
#> 9 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
#> 10 <NA> <NA> <NA> <NA> <NA> AGE 00 00 05 05
#> # … with 38,217 more rows, and 36 more variables: ..11 <chr>, ..12 <chr>,
#> # ..13 <chr>, ..14 <chr>, ..15 <chr>, ..16 <chr>, ..17 <chr>,
#> # ..18 <chr>, ..19 <chr>, ..20 <chr>, ..21 <chr>, ..22 <chr>,
#> # ..23 <chr>, ..24 <chr>, ..25 <chr>, ..26 <chr>, ..27 <chr>,
#> # ..28 <chr>, ..29 <chr>, ..30 <chr>, ..31 <chr>, ..32 <chr>,
#> # ..33 <chr>, ..34 <chr>, ..35 <chr>, ..36 <chr>, ..37 <chr>,
#> # ..38 <chr>, ..39 <chr>, ..40 <chr>, ..41 <chr>, ..42 <chr>,
#> # ..43 <chr>, ..44 <chr>, ..45 <chr>, ..46 <chr> Created on 2018-12-13 by the reprex package (v0.2.1.9000) There have been several "me too" comments. I invite those folks to install the dev version of readxl and see if it fixes things for their file too. If not, please open a new issue with a link to your xls or attach it in a zip archive. |
Hi,
I'm writing about an issue a bit similar to #373
When i download this file and I unzip it on my windows computer, The following line returns an error :
But when I open the file in Excel and resave as .xlsx, it works !
What should I do so that it works without opening the file in Excel ?
Thanks a lot !
The text was updated successfully, but these errors were encountered: