I have a list of CSV file names that I am trying to get the date out of in order to put them into order by date
Heres a snippet of the file names
csse_covid_19_data/csse_covid_19_daily_reports/02-01-2020.csv
csse_covid_19_data/csse_covid_19_daily_reports/01-31-2020.csv
csse_covid_19_data/csse_covid_19_daily_reports/02-02-2020.csv
csse_covid_19_data/csse_covid_19_daily_reports/01-24-2020.csv
csse_covid_19_data/csse_covid_19_daily_reports/01-29-2020.csv
I can get the date from a single file using
a_date_string= all_files[0].split("/")[-1].split(".")[0]
print(a_date_string)
which gives output
02-01-2020
How do I get the code to return all the dates? The code above was given I am just trying to manipulate it to be in order by the dates listed in the file name.