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]

Re: st: --insheet--reading an excel file where row 1,2 are variable names and labels


From   Neil Shephard <[email protected]>
To   [email protected]
Subject   Re: st: --insheet--reading an excel file where row 1,2 are variable names and labels
Date   Thu, 23 Sep 2010 14:55:18 +0000

On Thu, Sep 23, 2010 at 2:48 PM, Amanda Fu <[email protected]> wrote:

> Then my question is: is there any easy way to let Stata name the
> variables using first row and define labels using the second row when
> reading a data set from excel file?

No, Stata's -insheet- just doesn't work like that.

I'd remove the second row from your CSV file.  You can now -insheet,
names- (i.e. specify the -names- option when insheeting)  so your
first row of variable names is recognised, then write your do-file to
label these variables.

Neil

-- 
"One should as a rule, respect public opinion in so far as is
necessary to avoid starvation and to keep out of prison, but anything
that goes beyond this is voluntary submission to an unnecessary
tyranny, and is likely to interfere with happiness in all kinds of
ways..." - Bertrand Russell

Email - [email protected]
Website - http://slack.ser.man.ac.uk/
Photos - http://www.flickr.com/photos/slackline/
*
*   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