Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Re: RE: double quotes, macros, and foreach commands... oh my


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Re: RE: double quotes, macros, and foreach commands... oh my
Date   Fri, 5 Dec 2003 14:51:29 -0000

Much better than my suggestion. Many thanks. 

Nick 
n.j.cox@durham.ac.uk 

Michael Blasnik
 
> In regard to the second question, there is a simple way to 
> get a directory
> listing into a macro using Stata 8:
> 
> local datfiles: dir . files  "*.dat"
> 
> will put all .dat files in the current directory into the 
> local macro
> datfiles.  Each file name will be enclosed in double 
> quotes.  You can then
> use the code shown at the end of Nick's posting (levels, 
> followed by a
> loop).  See -help local- and look for the extended macro 
> function -dir- for
> a syntax explanation.

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index