Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: number of words in a text list


From   "Eric G. Wruck" <[email protected]>
To   [email protected]
Subject   Re: st: number of words in a text list
Date   Mon, 11 Jul 2005 16:20:25 -0400

I found it in Stata 9.0 by typing <help word> & then by clicking on <string functions>.  Apparently, wordcount() has been around since Stata 1 as I was able to use it in a little .do file that specified version 1.  In the new Stata manuals flip to page 173 of the Data Management manual.

EGW



>I don't see that function... where can I find it?
>f
>
>On Mon, 11 Jul 2005 15:52:00 -0400
> "Eric G. Wruck" <[email protected]> wrote:
>>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/
>
>*
>*   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/


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



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index