<?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: Removing first 4 Characters from a column along with a special character in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Removing-first-4-Characters-from-a-column-along-with-a-special/m-p/630227#M82840</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/47836"&gt;@Hams&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the part you would like to keep is always separated from the rest of the string by a blank space, you can using a recode formula like below to keep all "words" except the first one (which is a mix of characters and numbers but not separated by blank space). You can simply change "Column 1" column name by the column name in which you have the sample description.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Recode(
	:Column 1,
	{Word(
		[2 -1],
		_rcNow,
		Get Whitespace Characters() ||
		Get Punctuation Characters( Exclude Chars( "'-" ) ),
		Unmatched( _rcNow )
	)}
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this other option will help you,&lt;/P&gt;</description>
    <pubDate>Tue, 09 May 2023 15:28:55 GMT</pubDate>
    <dc:creator>Victor_G</dc:creator>
    <dc:date>2023-05-09T15:28:55Z</dc:date>
    <item>
      <title>Removing first 4 Characters from a column along with a special character</title>
      <link>https://community.jmp.com/t5/Discussions/Removing-first-4-Characters-from-a-column-along-with-a-special/m-p/630178#M82834</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a column that is a sample description and there is always a ~numbers before the description that I would like to remove from all rows. Only one row has the "~" in it. For Example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample:&lt;/P&gt;&lt;P&gt;126: Description AB&lt;/P&gt;&lt;P&gt;291: Description XYZ&lt;/P&gt;&lt;P&gt;~619: Description&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a JSL script that would remove the "~", first 3-digit numbers, and the ": " (including the space) from all rows within the Sample column? The data I'm looking at always has a3 digit numbers at the front along with the : and space. The problem is removing the ~ from one of the rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate the help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Josh&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 14:25:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Removing-first-4-Characters-from-a-column-along-with-a-special/m-p/630178#M82834</guid>
      <dc:creator>Hams</dc:creator>
      <dc:date>2023-05-09T14:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Removing first 4 Characters from a column along with a special character</title>
      <link>https://community.jmp.com/t5/Discussions/Removing-first-4-Characters-from-a-column-along-with-a-special/m-p/630214#M82836</link>
      <description>&lt;P&gt;Here's one way, essentially trimming the leading space from the last "word," using ":" as a delimiter. There are other ways, including Regex.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;/*JMP STATISTICAL DISCOVERY LLC (“JMP”) PERMITS THE USE OF THIS COMPUTER SOFTWARE CODE (“CODE”) ON AN AS-IS BASIS AND AUTHORIZES YOU TO USE THE CODE SUBJECT TO THE TERMS LISTED HEREIN.  BY USING THE CODE, YOU AGREE TO THESE TERMS.  YOUR USE OF THE CODE IS AT YOUR OWN RISK.  JMP MAKES NO REPRESENTATION OR WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRIGEMENT, AND TITLE, WITH RESPECT TO THE CODE.
You may use the Code solely as part of a software product you currently have licensed from JMP, JMP’s parent company SAS Institute Inc. (“SAS”), or one of JMP’s or SAS’s subsidiaries or authorized agents (the “Software”), and not for any other purpose.  The Code is designed to add functionality to the Software but has not necessarily been tested.  Accordingly, JMP makes no representation or warranty that the Code will operate error-free.  JMP is under no obligation to maintain, support, or continue to distribute the Code.
Neither JMP nor its licensors shall be liable to you or any third-party for any general, special, direct, indirect, consequential, incidental, or other damages whatsoever arising out of or related to your use or inability to use the Code, even if JMP has been advised of the possibility of such damages.  Except as otherwise provided above, the Code is governed by the same agreement that governs the Software.  If you do not have an existing agreement with JMP or SAS governing the Software, you may not use the Code.
JMP and all other JMP Statistical Discovery LLC product or service names are registered trademarks or trademarks of JMP Statistical Discovery LLC in the USA and other countries.  ® indicates USA registration.  Other brand and product names are registered trademarks or trademarks of their respective companies.
*/
Names Default To Here (1);
//make data table
dt = New Table( "Untitled",
	Add Rows( 3 ),
	New Column( "Sample",
		Character,
		"Nominal",
		Set Values(
			{"126: Description AB", "291: Description XYZ", "~619: Description"}
		)
	)
);
//remove unwanted characters
for each row (dt,
	:Sample = trim (word (-1, :Sample, ":"))
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 May 2023 14:49:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Removing-first-4-Characters-from-a-column-along-with-a-special/m-p/630214#M82836</guid>
      <dc:creator>Jed_Campbell</dc:creator>
      <dc:date>2023-05-09T14:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Removing first 4 Characters from a column along with a special character</title>
      <link>https://community.jmp.com/t5/Discussions/Removing-first-4-Characters-from-a-column-along-with-a-special/m-p/630227#M82840</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/47836"&gt;@Hams&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the part you would like to keep is always separated from the rest of the string by a blank space, you can using a recode formula like below to keep all "words" except the first one (which is a mix of characters and numbers but not separated by blank space). You can simply change "Column 1" column name by the column name in which you have the sample description.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Recode(
	:Column 1,
	{Word(
		[2 -1],
		_rcNow,
		Get Whitespace Characters() ||
		Get Punctuation Characters( Exclude Chars( "'-" ) ),
		Unmatched( _rcNow )
	)}
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this other option will help you,&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 15:28:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Removing-first-4-Characters-from-a-column-along-with-a-special/m-p/630227#M82840</guid>
      <dc:creator>Victor_G</dc:creator>
      <dc:date>2023-05-09T15:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: Removing first 4 Characters from a column along with a special character</title>
      <link>https://community.jmp.com/t5/Discussions/Removing-first-4-Characters-from-a-column-along-with-a-special/m-p/630501#M82865</link>
      <description>&lt;P&gt;There are many different ways of doing this, below is one option using regex&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Regex("126: Description AB", "~?\d{3}: (.+)$", "\1");
Regex("291: Description XYZ", "~?\d{3}: (.+)$", "\1");
Regex("~619: Description", "~?\d{3}: (.+)$", "\1");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://regex101.com/r/nMilGt/1" target="_blank"&gt;https://regex101.com/r/nMilGt/1&lt;/A&gt;&amp;nbsp;explains the regex a bit&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1683709841329.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/52685i900ACEFC17736958/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1683709841329.png" alt="jthi_0-1683709841329.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 09:10:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Removing-first-4-Characters-from-a-column-along-with-a-special/m-p/630501#M82865</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-05-10T09:10:53Z</dc:date>
    </item>
  </channel>
</rss>

