Otherwise put, I don't think -abbrev()- is a good function for your
problem. -abbrev()- is really intended to work with variable names, not
their contents.
replace myvar = "acquired" if strpos(myvar, "acquired")
may help.
Nick
[email protected]
Martin Weiss
***********
clear*
input str20 mystring
"acquired by alcatel"
"acquired by cisco"
end
g newstring=word( mystring,1)
l
***********
Sara Brighi
I have come across a problem. I have a string variable made up of 2338
observations. These observations differ in "private", "public",
"defunct" and "acquired...."; but the "acquired" observations ever
specify sth more (for instance "acquired by alcatel", or "acquired by
cysco"..ecc). I need to use abbrev() in order to have only "acquired".
*
* 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/