I do not have a reproducible example for this but asking it based on interest.
With a loop function in R, we are able to obtain all .csv from a directory with the below code:
file.list <- list.files(pattern='*.csv') #obtained name of all the files in directory
df.list <- lapply(file.list, read.csv) #list
Would it be possible for us to loop through a directory with .xlsx files instead with different number of sheets?
For instance: A.xlsx contains 3 sheets, Jan01, Sheet2 and Sheet3; B.xlsx contains 3 sheets, Jan02, Sheet2 and Sheet3 ... and so on. The first sheet name changes.
Is it possible to loop through a directory and just obtain the dataframes for the first sheet in all excel files?
Python or R codes are welcome!
Thank you!
