Bookmark and Share

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: extract string portion


From   Scott Merryman <[email protected]>
To   [email protected]
Subject   Re: st: extract string portion
Date   Tue, 27 Nov 2012 06:22:34 -0600

Another option would be to use -split-

drop _all
input str63 company
"OnlineChoice.com, Inc. (Exelon Corporation (NYSE:EXC))"
"Peppers & Rogers Group (TeleTech Holdings Inc. (NasdaqGS:TTEC))"
end

split company, gen(company) p("(")
split company3, gen(ticker) p(":")
replace ticker2 = subinstr(ticker2, "))", "",.)
drop company3
list

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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index