<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Count the number of words in a string? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/10249#M9944</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can someone tell me the best function to count the number of a words in a particular string?&amp;nbsp; 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?&amp;nbsp; I know SAS has a function COUNTW that does this, but I can't find anything in JMP that will do it.&amp;nbsp; Thanks in advance...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 30 Nov 2014 03:21:47 GMT</pubDate>
    <dc:creator>shahram</dc:creator>
    <dc:date>2014-11-30T03:21:47Z</dc:date>
    <item>
      <title>Count the number of words in a string?</title>
      <link>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/10249#M9944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can someone tell me the best function to count the number of a words in a particular string?&amp;nbsp; 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?&amp;nbsp; I know SAS has a function COUNTW that does this, but I can't find anything in JMP that will do it.&amp;nbsp; Thanks in advance...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Nov 2014 03:21:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/10249#M9944</guid>
      <dc:creator>shahram</dc:creator>
      <dc:date>2014-11-30T03:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Count the number of words in a string?</title>
      <link>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/10250#M9945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It takes two functions in JMP. The &lt;EM&gt;Words()&lt;/EM&gt; function returns a list of the words in a string and &lt;EM&gt;N Items()&lt;/EM&gt; gives the number of&amp;nbsp; items in a list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;N Items( Words( s, ";,")) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Nov 2014 07:22:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/10250#M9945</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2014-11-30T07:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Count the number of words in a string?</title>
      <link>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/10251#M9946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great, thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Nov 2014 07:36:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/10251#M9946</guid>
      <dc:creator>shahram</dc:creator>
      <dc:date>2014-11-30T07:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Count the number of words in a string?</title>
      <link>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/49187#M27954</link>
      <description>&lt;P&gt;Does the function&amp;nbsp;N Items exist only in JMP Pro?&lt;/P&gt;&lt;P&gt;Is there a way to count words or specific symbols in a string in regular JMP?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2018 22:21:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/49187#M27954</guid>
      <dc:creator>l_yampolsky</dc:creator>
      <dc:date>2018-01-03T22:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Count the number of words in a string?</title>
      <link>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/49191#M27957</link>
      <description>&lt;P&gt;N Items() is a function that has been a part of JMP for a long time.&amp;nbsp; Check in the Scripting Index of your version of JMP to make sure it is there.&amp;nbsp; I assume it will be.&amp;nbsp; It is an essential component of being able to deal with JMP Lists.&lt;/P&gt;
&lt;P&gt;Here is one way to count words and to count symbols&lt;/P&gt;
&lt;PRE&gt;Names Default To Here( 1 );&lt;BR /&gt;str1 = "This is a test of the counting of words";&lt;BR /&gt;str2 = "Here is* a way to* count * symbols";&lt;BR /&gt;Show( "Counting Words", N Items( Words( str1, " " ) ) );&lt;BR /&gt;Show( "Counting Symbols", N Items( Words( str2, "*" ) ) );&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2018 22:44:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/49191#M27957</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-01-03T22:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Count the number of words in a string?</title>
      <link>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/49193#M27959</link>
      <description>&lt;P&gt;Thanks! It does not appear in the pull-down function lists. But of course when I just type "N Items(.." etc. it works.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2018 22:53:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/49193#M27959</guid>
      <dc:creator>l_yampolsky</dc:creator>
      <dc:date>2018-01-03T22:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Count the number of words in a string?</title>
      <link>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/49195#M27960</link>
      <description>&lt;P&gt;I assume the pulldown menu you are referring to is in the Formula Editor.&amp;nbsp; That list is not the definative list of functions.&amp;nbsp; It contains those functions that "Typically" are used in a formula calculation.&amp;nbsp; The definative documentation is in the Scripting Index&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Help==&amp;gt;Scripting Index&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nitems.PNG" style="width: 895px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/8834i0635B531761C5D7A/image-size/large?v=v2&amp;amp;px=999" role="button" title="nitems.PNG" alt="nitems.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2018 23:06:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/49195#M27960</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-01-03T23:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Count the number of words in a string?</title>
      <link>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/49196#M27961</link>
      <description>&lt;P&gt;Yep, got it, thanks. Yeah, I had no idea that there are functions that are not in the function editor. Using JMP since ver 1, 1990-ies. Go figure.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2018 23:09:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/49196#M27961</guid>
      <dc:creator>l_yampolsky</dc:creator>
      <dc:date>2018-01-03T23:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: Count the number of words in a string?</title>
      <link>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/49232#M27987</link>
      <description>&lt;P&gt;Minor point - your symbol count could be off by 1 if the last character is not the symbol.&amp;nbsp; In Jim's example the result is 4 when there are actually only 3 symbols.&amp;nbsp; Here's one way to get the correct number of symbols:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;str2 = "Here is* a way to* count * symbols";
str3 = substitute(str2, "*", "");
nsymbols = length(str2) - length(str3);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'm curious if there's an easier way to do this?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 15:49:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/49232#M27987</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2018-01-04T15:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Count the number of words in a string?</title>
      <link>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/49278#M28011</link>
      <description>&lt;P&gt;this method did occur to me, but it was not erfect for my goal of counting words in a string with words separated by a variety of delimiters, would have had to do this several time for each delimiter.&lt;/P&gt;&lt;P&gt;N Items(Words(string, " ,;|:_")) works great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 22:13:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-the-number-of-words-in-a-string/m-p/49278#M28011</guid>
      <dc:creator>l_yampolsky</dc:creator>
      <dc:date>2018-01-04T22:13:54Z</dc:date>
    </item>
  </channel>
</rss>

