Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: RE: Re: Populating a local macro

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

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

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

See -help extended_fcn-. Alternatively, look at -fs- from SSC. There are yet more alternatives. 


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:

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index