Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Chamara Anuranga <kcanuranga@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
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 <roberts.john.adam@gmail.com> 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/