Dear statalisters,
I would like to extract all the sub directory names present in the parent directory and store these names into a local.
I've been seeking for advice on forums and found the following command that I tried to adapt
But nothing goes out
The purpose would be to use all the elements from `f_names' and then extract the names of text files within each file of f_names directories. I'm planning to do something like
Thank you for your kind help
Dusan
(Stata 14.1)
I would like to extract all the sub directory names present in the parent directory and store these names into a local.
I've been seeking for advice on forums and found the following command that I tried to adapt
Code:
local f_names: dir "C:/A/Parent/" files "*" // as these are directories and not *.txt or *.dta display "`f_names'" *However nothing is returned
The purpose would be to use all the elements from `f_names' and then extract the names of text files within each file of f_names directories. I'm planning to do something like
Code:
foreach fn of local f_names{ local txt_files: dir "C:/A/Parent/`fn'" files "*.txt" }
Dusan
(Stata 14.1)
Comment