0

Have been trying to load an Excel file that is inside a folder that contains an accent but have not been able to do it.

Thorugh the normal process, I get the following Error:

ent \<- "2. En proceso/IPP 120-01-2022 Reglamento Ferroviario/Datos/" 

df \<- read_xls(paste0(ent, "Contratos2022_2203220927", ".xlsx"))

Error:    filepath: C:\\Users\\paulo\\OneDrive - El Colegio de México A.C\\2. Diputados\\1. Con impacto\\2. En proceso\\IPP 120-01-2022 Reglamento Ferroviario\\Datos\\Contratos2022_2203220927.xlsx   libxls error: Unable to open file

The problem seems to be in the word "México". Tried to solve the problem with

ent <- Sys.glob(paste0(getwd(), "/", "2. En proceso/IPP 120-01-2022 Reglamento Ferroviario/Datos/"))
df \<- read_xls(paste0(ent, "Contratos2022_2203220927", ".xlsx"))

But then I get the following message:

Error:    filepath: C:\Users\paulo\OneDrive - El Colegio de México A.C\2. Diputados\1. Con impacto\2. En proceso\IPP 120-01-2022 Reglamento Ferroviario\Datos\Contratos2022_2203220927.xlsx   libxls error: Unable to open file

Although the accent is fixed, the problem persists.

Have tried to run the code with different file encodings (Windows-1252 & UFT-8) but nothing works. My locale configuration is:

> Sys.getlocale()

> \[1\] "LC_COLLATE=Spanish_Mexico.1252;LC_CTYPE=Spanish_Mexico.1252;LC_MONETARY=Spanish_Mexico.1252;LC_NUMERIC=C;LC_TIME=Spanish_Mexico.1252"
JosefZ
  • 28,460
  • 5
  • 44
  • 83
Paul OHF
  • 53
  • 1
  • 4
  • 3
    It seems you are using a specific computer language, right? Probably you should tag the question with such language, to make your question visible to relevant people – Giacomo Catenazzi Mar 23 '22 at 16:42
  • To solve the problem I had delete R Studio and reinstall it. After that, it worked perfectly. Thanks! – Paul OHF Jun 29 '22 at 23:25

0 Answers0