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, statalist.org is already up and running.


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

Re: st: writing a loop


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: writing a loop
Date   Fri, 21 Sep 2012 01:05:12 +0100

The Statalist FAQ does advise you to declare if you are using an
out-of-date version of Stata, here 11 rather than 12.1. (The
difference between MP and SE is immaterial to your question.)

I guessed that this was your problem and posted a link to the help for
-export_excel- which is accessible at the Stata website.

As you signalled that other problems will follow, you will need to
keep flagging use of 11.

Nick

On Thu, Sep 20, 2012 at 11:16 PM, Amir Kasaeian <amir_kasaeian@yahoo.com> wrote:

> Thanks, I got it.
> The problem is the difference between Stata 11mp and Stata12se.
> The statement "export excel" is not available in stata11se.

On Fri, 21/9/12, David Radwin <dradwin@mprinc.com> wrote:

>> Nick's reply seems to have been cut off by the listserv, but
>> I will add
>> that if you want actual Excel files, use -export excel-
>> instead of
>> -outsheet-. See the help file for details.

On Thu, Sep 20, 2012 at 6:41 PM, Amir Kasaeian <amir_kasaeian@yahoo.com>

>> > > I wrote a loop for reading stata files and then
>> export them in csv
>> > format.
>> > > Now, I want to export them in xls or xlsx formats,
>> but I don't know
>> how.
>> > > How can I do this?
>> > > my codes are as follows:
>> > > How should I change it to do my work?
>> > >
>> > > forvalues i= 0/29{
>> > >  use "C:\Step\Total88\Step`i'.dta", clear
>> > > outsheet using "C:\Step\Total88\Step`i'.csv",
>> comma replace
>> > > }
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index