-split- here offers one road, but I think a better
solution is something like
substr(company,1,index(company,",")-1)
Nick
[email protected]
Daniel Waxman
> There are many ways to do this, but I find .split() to be a
> very useful command.
Dev Vencappa
> apologies if this has been posted before and I missed it. I
> have a string
> variable which is the name of companies (fictitious example follows):
>
> XYZ, International
> ABCDE, National
> DFTRER, Exports
>
> etc
>
> I want to keep only the first part of the company name (e.g.
> keep XYZ ABCDE
> DFTRER, etc). The obvious solution is to ask Stata to read
> the letters and
> chop off anything from the character "," onwards, but am not
> very sure which
> command to use in Stata 8.2 to be able to do that.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/