205690/download-multiple-excel-files-linked-through-urls-in-r
I have a list containing hundreds of URLs directly linking to .xlsx files for a download:
list <- c("https://ec.europa.eu/consumers/consumers_safety/safety_products/rapex/alerts/?event=main.weeklyReport.Excel&web_report_id=980", "https://ec.europa.eu/consumers/consumers_safety/safety_products/rapex/alerts/?event=main.weeklyReport.Excel&web_report_id=981", "https://ec.europa.eu/consumers/consumers_safety/safety_products/rapex/alerts/?event=main.weeklyReport.Excel&web_report_id=990")
To download everything in the list, I created a loop:
for (url in list) { download.file(url, destfile = "Rapex-Publication.xlsx", mode="wb") }
However, it only downloads the first file and not the rest. My guess is that the program is overwriting the same destfile. What would I have to do to circumvent this issue?
Try something along the lines of:
for (i in 1:length(list)) { download.file(list[i], destfile = paste0("Rapex-Publication-", i, ".xlsx"), mode="wb") }
One application only. It would be quicker ...READ MORE
Hello, to open xlxs files, or files ...READ MORE
Please can someone help me on the ...READ MORE
0 Your b effort would be a good ...READ MORE
The Excel manual method: choose Text to Column ...READ MORE
I looked at the pdf, and it ...READ MORE
Here is a solution utilizing the XLConnect ...READ MORE
you have the XLConnect package. Read the documentation or the vignette of that ...READ MORE
Solution: library(tidyverse) dat <- read_xlsx("Book1.xlsx") dat2 <- read_xlsx("Book2.xlsx") book1_output <- anti_join(dat,dat2, ...READ MORE
Use Spellchecker for doing your stuff: import pandas ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.