Bookmark and Share

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: Re: Populating a local macro


From   "Sherriff, Martyn" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: RE: Re: Populating a local macro
Date   Tue, 12 Oct 2010 21:12:49 +0100

Nick,
	As always - thanks for your help. I must improve my Stata search techniques.
Martyn

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Nick Cox
Sent: Tuesday, October 12, 2010 2:57 PM
To: '[email protected]'
Subject: st: RE: Re: Populating a local macro

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/

*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index