Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: RE: Re: Populating a local macro
From
Nick Cox <[email protected]>
To
"'[email protected]'" <[email protected]>
Subject
st: RE: Re: Populating a local macro
Date
Tue, 12 Oct 2010 14:57:22 +0100
See -help extended_fcn-. Alternatively, look at -fs- from SSC. There are yet more alternatives.
Nick
[email protected]
Sherriff, Martyn
I have some data that is created by a test machine which generates 5 datafiles within a directory. Typically there are 20+ directories. If I put these directory names into the local macro name then I can read all the data as follows with this do file fragment:
local name ""Damon_mx 16x22 3M_1.is_comp_RawData" "Damon_mx 16x22 ormco.is_comp_RawData" "Damon_mx 16x22 tp_1.is_comp_RawData" .......
and then do the necessary data processing.
My problem is that I have to create the local by hand and it changes with each experiment - and the name structure can lead to (my) data entry errors.
I can get a list of the relevant directory names using:
! dir /ad /b >dirlist.txt
. file open myfile using dirlist.txt, read
Is there a way of getting this directory list into the local macro name? I am using Stata 11.
*
* 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/