Note that -fs- must be installed from SSC for any of this to work.
Nick
[email protected]
Johannes Geyer
You can use wildcards " * ".
type
help fs
there you find an example:
fs *.dta
> I have the following problem, I want to run a loop on all the dta
> files in a directory, I currently have the following code, but am
> having difficulties because I get an error when a do file is included
> in the r(files) macro. Is there anyway I can run this only on .dta
> files? My code is as following...
>
> log using jfilesearch, replace
> fs
> foreach var in `r(files)' {
> clear
> use `var'
> capture, describe *gdp*
> }
> log close
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/