12666727b9
12666727b9

Reputation: 1139

Extract iteratively data in subfolders within folder into googledrive

In a general folder, I have this subset of subfolders which I would like to open iteratively to download datasets in .xlsx format

In the following major folder:

enter image description here

there are these subfolders that as you could see has a specific pattern name

enter image description here

and within each of them, there is a .xlsx dataset

enter image description here

named as similarly as the main subfolder where it is contained

I was wondering on extract them using some iterative function. Based on the code I have found through the forum I have found something that I have readapted as for loop, but with no results.

url = 'urlnamexxx'
for (folder in url) {
  temp <- tempfile(fileext = ".xlsx")
  download.file(url, temp)
  readxl::read_xlsx(temp)
}

Could you please give some suggestions?

Please in case something is not clear, just comment down below and let me the details I should provide.

Upvotes: 1

Views: 189

Answers (0)

Related Questions