I unzipped, extracted, and renamed the CBG files within Stata and renamed them using the Stata date convention, which I found made it easier to then loop over the csv’s

With help from @Martin_Andersen_UNC_Greensboro, I unzipped, extracted, and renamed the CBG files within Stata and renamed them using the Stata date convention, which I found made it easier to then loop over the csv’s. Code for the April 2020 files:

local month=“04”
local days=“01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21”

foreach day of local days {
local date=mdy(month', day’, 2020)

shell "C:\Program Files\7-Zip\7z" x "C:\Users\jed\safegraph\v1\2020\"`month'"\"`day'"\2020-"`month'"-"`day'"-social-distancing.csv.gz" -o"C:\Users\jed\safegraph\v1" -aoa
!rename "C:\Users\jed\safegraph\v1\2020-"`month'"-"`day'"-social-distancing.csv" "safegraph"`date'".csv"

}