On 8/5/02 16:38, Li, Wenjun wrote
>A quick question about macro operation:
>
>I have a long list of names that are stored in a macro, such as
> local namelist `aa bb cc def ghi .....................'
>I would like to change them to
> local namelist2 'aa_g bb_g cc_g def_g ghi_g ................' etc.
>
>How could I do that?
>
The following would work (either from the command window or in an (a)do
file):
foreach name of local namelist {
local newlist "`newlist' `name'_g"
}
Bill
*
* 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/