Colleagues,
I have a number of data sets that are saved with use of the following code:
As you can presume the ls will produce the following output:
I would like to draft some code that will always load the most recent data set, either using the system information on file modification or, preferably, date information stored in the file name.
I have a number of data sets that are saved with use of the following code:
Code:
local c_date = c(current_date) local c_time = c(current_time) local c_time_date = "`c_date'"+"_" +"`c_time'" local time_string = subinstr("`c_time_date'", ":", "_", .) local time_string = subinstr("`time_string'", " ", "_", .) display "`time_string'" save .\Data\nl_full_`time_string'.dta, replace
Code:
. ls <dir> 9/12/14 15:33 . <dir> 9/12/14 15:33 .. 14.5M 9/12/14 14:43 nl_full_12_Sep_2014_14_43_53.dta 14.5M 9/12/14 15:33 nl_full_12_Sep_2014_15_33_02.dta
Comment