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]

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


From   Amanda Fu <mandy.fu1@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: --insheet--reading an excel file where row 1,2 are variable names and labels
Date   Thu, 23 Sep 2010 10:48:14 -0400

Dear Statalisters,

I got a question when I tried to read an excel file (.csv) into Stata.
In the excel file, the first row and the second row are for the
variable name and labels respectively. But when using --insheet
using---, Stata renamed the variables and the labels are not shown.
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?

------------------------------------------------------------EXCEL file
name	state	age	a11                     a12
name	state	age	interview type       household NO.
AJ	MA	21	a                           001
.........
------------------------------------------------------------
After using --insheet---, the stata data file looks like this:
-------------------------------------------------------------census_variables_copy
var1        var2            var3          var4                     var5
name	state	age	a11                     a12
name	state	age	interview type       household NO.
AJ	MA	21	a                           001
.........
------------------------------------------------------------
Thanks for your time!

Best wishes,
Amanda
*
*   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