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]
st: variable name with special character
From
Jeph Herrin <[email protected]>
To
[email protected]
Subject
st: variable name with special character
Date
Mon, 10 Feb 2014 15:22:34 -0500
All,
I used Stat/Transfer v12 to create a Stata dataset from an Excel file.
When I open the file in Stata, I find that many of the variable names
have special characters (apparently), because Stata can't see them. Example:
. d A3*
storage display value
variable name type format label variable label
------------------------------------------------------------
A3 str2 %2s
A3a str2 %2s
A3b str2 %2s
A3c_1 str2 %2s
A3c_2 str2 %2s
A3c_3 str2 %2s
A3c_4 str2 %2s
A3c_5 str2 %2s
A3c_6 str2 %2s
A3c_7 str2 %2s
. d A3
A3 ambiguous abbreviation
r(111);
So there seems to be a non-printing character trailing -A3-; I have
dozens of these in the dataset. In the original excel file, all seems to
be in order. There are trailing blanks in the top row; however,
. renvars _all, postsub(" " "")
no renames necessary
Any thoughts on how I can identify and repair the problem with these
variable names?
thanks,
Jeph
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/