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:how to delete anything in the bracket for a string variable
From
daniel klein <[email protected]>
To
[email protected]
Subject
Re: st:how to delete anything in the bracket for a string variable
Date
Sun, 9 Oct 2011 22:49:38 +0200
I just came accross an ado that could be used for this. It dates back
to 2003 and was written by Bill Rising.
. ssc d vtokenize
The syntax to solve Amanda's problem would be
. vgettoken new : name ,parse("(")
As is the case with -substr- this assumes that you only want to keep
the stuff before the first parentheses.
Best
Daniel
--
Hi All,
I wonder if someone can give me some suggestion on delete anything in
the bracket for a string variable. A string variable in my data set
has some notes in bracket for part of the observations. I want to
remove the brackets and anything in them
[...]
*
* 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/