<?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 script to find and replace portions of character entries in a column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-portions-of-character-entries-in-a/m-p/266929#M51998</link>
    <description>&lt;P&gt;In my data table, I have a column of data type Character with a column name of Size.&amp;nbsp; The entries for the different rows in column Size are like 8 or so different variations of things like sglLrg500, sglLrg800, sglLrg150, etc.&amp;nbsp; I would like to have a JMP script that can quickly replace sgl in each of the entries in Size with Sgl instead, so that sglLrg500 for example would become SglLrg500.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could do this manually by selecting the Size column then selecting Edit, Search, Find, and then set Find What to sgl and Replace With to Sgl and check the box for "Restrict to selected columns" and the click Replace All.&amp;nbsp; But I would like if possible a simple JMP script to do the same thing.&amp;nbsp; Thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 15 May 2020 14:48:02 GMT</pubDate>
    <dc:creator>fbm73</dc:creator>
    <dc:date>2020-05-15T14:48:02Z</dc:date>
    <item>
      <title>script to find and replace portions of character entries in a column</title>
      <link>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-portions-of-character-entries-in-a/m-p/266929#M51998</link>
      <description>&lt;P&gt;In my data table, I have a column of data type Character with a column name of Size.&amp;nbsp; The entries for the different rows in column Size are like 8 or so different variations of things like sglLrg500, sglLrg800, sglLrg150, etc.&amp;nbsp; I would like to have a JMP script that can quickly replace sgl in each of the entries in Size with Sgl instead, so that sglLrg500 for example would become SglLrg500.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could do this manually by selecting the Size column then selecting Edit, Search, Find, and then set Find What to sgl and Replace With to Sgl and check the box for "Restrict to selected columns" and the click Replace All.&amp;nbsp; But I would like if possible a simple JMP script to do the same thing.&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 14:48:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-portions-of-character-entries-in-a/m-p/266929#M51998</guid>
      <dc:creator>fbm73</dc:creator>
      <dc:date>2020-05-15T14:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: script to find and replace portions of character entries in a column</title>
      <link>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-portions-of-character-entries-in-a/m-p/266935#M51999</link>
      <description>&lt;P&gt;Why a script? Have you looked at Cols &amp;gt; Recode?&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 15:01:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-portions-of-character-entries-in-a/m-p/266935#M51999</guid>
      <dc:creator>Dan_Obermiller</dc:creator>
      <dc:date>2020-05-15T15:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: script to find and replace portions of character entries in a column</title>
      <link>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-portions-of-character-entries-in-a/m-p/267000#M52005</link>
      <description>&lt;P&gt;One option is to use regex, it has a pretty steep learning curve but is very powerful:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Regex( :Original Column, "sgl", "Sgl", IGNORECASE, GLOBALREPLACE )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here is an example table:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Table( "Replace Example",
	Add Rows( 3 ),
	New Column( "Original", Character, "Nominal", Set Values( {"sglLrg500", "sglLrg800", "sglLrg150"} ) ),
	New Column( "Clean",
		Character,
		"Nominal",
		Formula( Regex( :Original, "sgl", "Sgl", IGNORECASE, GLOBALREPLACE ) ),
		Set Selected,
		Set Display Width( 72 )
	)
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 19:10:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-portions-of-character-entries-in-a/m-p/267000#M52005</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2020-05-15T19:10:55Z</dc:date>
    </item>
  </channel>
</rss>

