Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Question for Statalist about "Creating a macro for files"


From   Ronnie Babigumira <rb.glists@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Question for Statalist about "Creating a macro for files"
Date   Wed, 19 Apr 2006 18:48:27 +0200

forval i = 1/2 {
 u data`i' , clear
 outsheet using bra`i'.xls
 }



Riano, Juanita wrote:
Hi all,
I am trying to use the foreach command to "outsheet" five statafiles
into 5 excel files but don't know how to create the two lists.
So far I have this...

#delimit; foreach file in oilgs.dta data2.dta data3.dta {;
outsheet using bra1.xls bra2.xls bra3.xls , replace;
};

But it doesn't recognize the list of xls files

Thank you

---------------------------------------------
Juanita Riano
International Monetary Fund
Research Department
jriano@imf.org
phone 202-623-5437


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

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



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index