How about the wordcount() function. Here's an example:
. gen wordcount = wordcount(locations)
. l
+----------------------------------------------------------------+
| locations wordco~t |
|----------------------------------------------------------------|
1. | Alabama Delaware Kansas Wyoming 4 |
2. | Marburg Hachborn Hindelang Oldenburg 4 |
3. | Rochester Ithaca Cambridge Wellesley Gahanna Bexley 6 |
+----------------------------------------------------------------+
Later,
Eric
also, is there a way to count how many WORDS are in a string without making a loop to go through
the string and check that way ( I want something faster).
thanks,
Florence
--
===================================================
Eric G. Wruck
Econalytics
2535 Sherwood Road
Columbus, OH 43209
ph: 614.231.5034
cell: 614.330.8846
eFax: 614.573.6639
eMail: [email protected]
website: http://www.econalytics.com
====================================================
*
* 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/