I have multiple .csv files in a folder that I would like to combine into multiple dataframes. I already can do this for one set of files using the following code:
I have standard file names like this for about 5 weeks worth of data. What I want to do is make a loop. For example, the first batch of file names ends in "week1" with the next set ending in "week2". I'm trying to write something that would recognize that the number after "week" has changed and to now combine those .csv files into a new data frame (DF_week2, DF_week3, etc.). I'm unfortunately a bit stuck here and rather new to looping.
If all your files share the same column structure, you can read them all at once and then separate them into individual data frames, obviously, I can't test the code since I don't have access to your files but it would be something like this.