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: Removing quotation marks in string variables
From
Chamara Anuranga <[email protected]>
To
[email protected]
Subject
Re: st: Removing quotation marks in string variables
Date
Fri, 5 Jul 2013 22:54:13 +0530
Hi,
use following
replace var1 = subinstr(var1,`"""',"",10)
This will replace " as empty 10 times in the variable var1. you have
to use `' sings and quotation.
Thanks,
Chamara
On Fri, Jul 5, 2013 at 10:27 PM, John Adam Roberts
<[email protected]> wrote:
> Hi,
>
> I have a dataset that is full of strings that look like this:
>
> ATUS00001213, "ATUS00001256","Jackson,Collin"
>
> I'm going to separate these values into different variables and I'm
> wondering how to remove the "s from the dataset.
>
> For other characters, like commas, I would use the following command:
> replace tags = subinstr(tags,",","",.)
>
> but
> replace tags = subinstr(tags,""","",.)
> replace tags = subinstr(tags,'"',"",.)
> replace tags = subinstr(tags,""",.,.)
> replace tags = subinstr(tags,'"',.,.)
> don't work.
>
> Thanks in advance for the help!
>
> -Adam
> *
> * 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/
*
* 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/