Subscribe Bookmark RSS Feed

Count the number of words in a string?

shahram

Community Trekker

Joined:

Nov 29, 2014

Can someone tell me the best function to count the number of a words in a particular string?  For example, if I have a column of character data delimited by ";" or "," how do I count the number of "words" in that column, as defined by the particular delimiter?  I know SAS has a function COUNTW that does this, but I can't find anything in JMP that will do it.  Thanks in advance...

2 REPLIES
ms

Super User

Joined:

Jun 23, 2011

It takes two functions in JMP. The Words() function returns a list of the words in a string and N Items() gives the number of  items in a list.

N Items( Words( s, ";,"))

shahram

Community Trekker

Joined:

Nov 29, 2014

Great, thanks a lot.