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: Populating a local macro
From
"Sherriff, Martyn" <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: Re: Populating a local macro
Date
Tue, 12 Oct 2010 14:48:46 +0100
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.
Many thanks.
Martyn
*
* 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/