<?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 RE: Logic to separate sentence into word in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Logic-to-separate-sentence-into-word/m-p/90422#M40640</link>
    <description>&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/43626"&gt;@NayanaH_P&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;You can achieve this with two actions in the Blue Prism "Utility - Strings" VBO:&lt;BR /&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1; padding-left: 40px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19474.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19618i75D8125915FF14DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="19474.png" alt="19474.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
Taking the following sentence:&lt;BR /&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1; padding-left: 40px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19475.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19626iDBFE5EB5A08C143E/image-size/large?v=v2&amp;amp;px=999" role="button" title="19475.png" alt="19475.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;BR /&gt;We can perform the following steps on it:&lt;BR /&gt;&lt;BR /&gt;
&lt;OL&gt;
&lt;LI&gt;Use the "Regex Replace" action to remove all punctuation in the sentence with the regex pattern "&lt;SPAN style="font-family: 'Courier New', monospace;"&gt;[^\w\s\-']&lt;/SPAN&gt;" which tells the action to ignore word characters, spaces, apostrophes and hyphens. Anything else will be replaced by an empty string.&amp;nbsp; &amp;nbsp;&lt;/LI&gt;
&lt;/OL&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1;"&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1; padding-left: 40px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19476.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19627i62E82B104A06F968/image-size/large?v=v2&amp;amp;px=999" role="button" title="19476.png" alt="19476.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;
&lt;OL start="2"&gt;
&lt;LI&gt;Use the "Split Text" action to take anything left over from the previous action and separate them, by space, into a collection:&lt;/LI&gt;
&lt;/OL&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1; padding-left: 40px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19477.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19632iFE6583FA8283CFFC/image-size/large?v=v2&amp;amp;px=999" role="button" title="19477.png" alt="19477.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;BR /&gt;Then you end up with a collection like this:&lt;/P&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1; padding-left: 40px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19478.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19634i8F4F9BBAC4266AAF/image-size/large?v=v2&amp;amp;px=999" role="button" title="19478.png" alt="19478.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Micheal Charron&lt;BR /&gt;Senior Manager&lt;BR /&gt;RBC&lt;BR /&gt;America/Toronto&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Fri, 12 Aug 2022 14:50:00 GMT</pubDate>
    <dc:creator>MichealCharron</dc:creator>
    <dc:date>2022-08-12T14:50:00Z</dc:date>
    <item>
      <title>Logic to separate sentence into word</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Logic-to-separate-sentence-into-word/m-p/90420#M40638</link>
      <description>&lt;SPAN&gt;Take input as any sentence. Use logic to separate out each word in the sentence and fill each word in different rows of collection. The code should work for any sentence we take (may it be of any number of words)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Nayana H P&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Aug 2022 12:19:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Logic-to-separate-sentence-into-word/m-p/90420#M40638</guid>
      <dc:creator>NayanaH_P</dc:creator>
      <dc:date>2022-08-12T12:19:00Z</dc:date>
    </item>
    <item>
      <title>RE: Logic to separate sentence into word</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Logic-to-separate-sentence-into-word/m-p/90421#M40639</link>
      <description>Hi &lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/43626"&gt;@NayanaH_P&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;The easy way to achieve this is using the split function that you found in the "Utility - Strings" VBO.&lt;BR /&gt;&lt;BR /&gt;But, if you are asking for the logic behind , let's think how can we build our own "Split" function in Blue Prism.&lt;BR /&gt;&lt;BR /&gt;First you need is to implement a loop. When we talk about loops, they don't necessarily have to be loops made with the Loop Stage. A circular path is also a loop.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;We need a circular path, because we don't have any collection to iterate with the Loop stage. But, what need to put inside? Usually, when we talk about separate "things", we have a full list of this "things" (a full sentence with words), and this "things" are separated from each other by a separator. &lt;BR /&gt;&lt;BR /&gt;Understanding this, you have a sentence with words, and this words are separate by an space. The first word start in the position 0 of the sentence until the first separator, the second one start in the first separator until the second separator....&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19473.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19624iF4014012687D9760/image-size/large?v=v2&amp;amp;px=999" role="button" title="19473.png" alt="19473.png" /&gt;&lt;/span&gt;&lt;BR /&gt;So far so clear.&lt;BR /&gt;&lt;BR /&gt;To know the position of a character inside the text you need to use the function "InStr". Of course, our text have 3 separators, this functions returns only the first separator that it founds. &lt;BR /&gt;&lt;BR /&gt;Then you can use the function "Mid" to get the "sub text" from the entry text. The Mid function take 3 parameters, the original text, the start position, and the length. Allways the start position that we want is 1. And the length? Easy, the length is the char index of the first separator (Using the InStr function). And you get the first word!!!&lt;BR /&gt;&lt;BR /&gt;But... where is the loop?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;We have the method to get only the first word in the sentence... how can we make to get the second one? Easy, delete the first word from the setence and repeat the previous logic (Take the sub string using the Mid function...). There is no "delete" function, but exists "Replace" this function replace from one original text, one text for another.&lt;BR /&gt;&lt;BR /&gt;In our example.... I get the first word "This" and I will replace "This " (adding an space at the end) from "This is the sentence". And I get returned "is the sentence."&lt;BR /&gt;&lt;BR /&gt;My loop stop when I have no more text inside the original string (Or in other words, when the length of the text is equal to 0)&lt;BR /&gt;&lt;BR /&gt;And this is all. Is clear all the logic?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps you! And if this solves the problem, remember mark this as the best answer &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;See you in the Community, bye &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Pablo Sarabia&lt;BR /&gt;Solution Manager &amp;amp; Architect&lt;BR /&gt;Altamira Assets Management&lt;BR /&gt;Madrid&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Aug 2022 13:26:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Logic-to-separate-sentence-into-word/m-p/90421#M40639</guid>
      <dc:creator>PabloSarabia</dc:creator>
      <dc:date>2022-08-12T13:26:00Z</dc:date>
    </item>
    <item>
      <title>RE: Logic to separate sentence into word</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Logic-to-separate-sentence-into-word/m-p/90422#M40640</link>
      <description>&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/43626"&gt;@NayanaH_P&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;You can achieve this with two actions in the Blue Prism "Utility - Strings" VBO:&lt;BR /&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1; padding-left: 40px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19474.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19618i75D8125915FF14DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="19474.png" alt="19474.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
Taking the following sentence:&lt;BR /&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1; padding-left: 40px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19475.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19626iDBFE5EB5A08C143E/image-size/large?v=v2&amp;amp;px=999" role="button" title="19475.png" alt="19475.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;BR /&gt;We can perform the following steps on it:&lt;BR /&gt;&lt;BR /&gt;
&lt;OL&gt;
&lt;LI&gt;Use the "Regex Replace" action to remove all punctuation in the sentence with the regex pattern "&lt;SPAN style="font-family: 'Courier New', monospace;"&gt;[^\w\s\-']&lt;/SPAN&gt;" which tells the action to ignore word characters, spaces, apostrophes and hyphens. Anything else will be replaced by an empty string.&amp;nbsp; &amp;nbsp;&lt;/LI&gt;
&lt;/OL&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1;"&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1; padding-left: 40px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19476.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19627i62E82B104A06F968/image-size/large?v=v2&amp;amp;px=999" role="button" title="19476.png" alt="19476.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;
&lt;OL start="2"&gt;
&lt;LI&gt;Use the "Split Text" action to take anything left over from the previous action and separate them, by space, into a collection:&lt;/LI&gt;
&lt;/OL&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1; padding-left: 40px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19477.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19632iFE6583FA8283CFFC/image-size/large?v=v2&amp;amp;px=999" role="button" title="19477.png" alt="19477.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;BR /&gt;Then you end up with a collection like this:&lt;/P&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1; padding-left: 40px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19478.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19634i8F4F9BBAC4266AAF/image-size/large?v=v2&amp;amp;px=999" role="button" title="19478.png" alt="19478.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Micheal Charron&lt;BR /&gt;Senior Manager&lt;BR /&gt;RBC&lt;BR /&gt;America/Toronto&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Aug 2022 14:50:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Logic-to-separate-sentence-into-word/m-p/90422#M40640</guid>
      <dc:creator>MichealCharron</dc:creator>
      <dc:date>2022-08-12T14:50:00Z</dc:date>
    </item>
  </channel>
</rss>

