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]

Re: st:how to delete anything in the bracket for a string variable


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st:how to delete anything in the bracket for a string variable
Date   Mon, 10 Oct 2011 01:44:11 +0100

There seems no point in invoking an .ado to do what can be done
directly with a function call.

Naturally that doesn't mean that Bill's package can't be useful.

Nick

On Sun, Oct 9, 2011 at 9:49 PM, daniel klein
<klein.daniel.81@googlemail.com> wrote:

> 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.



> 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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index