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: remove special characters from string
From
Skipper Seabold <[email protected]>
To
[email protected]
Subject
st: remove special characters from string
Date
Tue, 2 Nov 2010 15:56:49 -0400
I'm trying to use reshape with a string variable, but my string
variable contains special characters. Is there a way (ideally without
using mata) to do something like (intuitively)
gen str6 newstring = string(oldstring), ignore(".-")
Ie., I have data that looks like
oldstring
A.X.B-2
A.X.B-3
A.X.B-2
A.X.B-3
I would ideally just like to create
AXB2
AXB3
AXB2
AXB3
Or should I just use a scripting language to preprocess...
Skipper
*
* 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/