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, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: extract string portion

From   Scott Merryman <>
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
", Inc. (Exelon Corporation (NYSE:EXC))"
"Peppers & Rogers Group (TeleTech Holdings Inc. (NasdaqGS:TTEC))"

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

*   For searches and help try:

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