Hi,
I have been trying to retrieve the most recent folder out of a number of folders named by dates to set the path for an import delimited but even though displaying my saved local macro works, import delimited returns invalid '2022.02.02' when I use this local macro. Does anyone know what I am doing wrong? Please see my code below.
Thanks,
Nicolas
I have been trying to retrieve the most recent folder out of a number of folders named by dates to set the path for an import delimited but even though displaying my saved local macro works, import delimited returns invalid '2022.02.02' when I use this local macro. Does anyone know what I am doing wrong? Please see my code below.
Thanks,
Nicolas
Code:
folders "../data/" local date = word(r(folders), -1) display `date' import delimited using "../data/`date'/stuff.csv", clear

Comment