<?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: How do i rename column header name with existing string? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-i-rename-column-header-name-with-existing-string/m-p/549100#M76567</link>
    <description>&lt;P&gt;You need to use &amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&amp;lt;&amp;lt; set name&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to change the name of the column&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

colList = dt &amp;lt;&amp;lt; get column names( string );

For( i = 1, i &amp;lt;= N Items( colList ), i++,
	If( Left( colList[i], 48 ) == "ABC_12::ABCD_AB_ABCDEF_A_ABCDE_X_X_A1_1234_ABCD_",
		Column( dt, colList[i] ) &amp;lt;&amp;lt; set name( Substr( colList[i], 49 ) ), // this is the part where i m stuck.
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Sep 2022 10:09:59 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2022-09-26T10:09:59Z</dc:date>
    <item>
      <title>How do i rename column header name with existing string?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-i-rename-column-header-name-with-existing-string/m-p/549087#M76566</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to rename multiple column header name that consists a particular string but rename it with the existing string while remove the front portion of the string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;ABC_12::ABCD_AB_ABCDEF_A_ABCDE_X_X_A1_1234_ABCD_&lt;/FONT&gt;&lt;FONT color="#00FF00"&gt;TESTING_AB_TEST_ABCD_TESTED_AB_A1&lt;/FONT&gt; --&amp;gt;&amp;nbsp;TESTING_AB_TEST_ABCD_TESTED_AB_A1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The number of character on the first part of the string (orange) will always be consistent, the 2nd portion of the string will vary from 1 to another.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What have i done so far is the below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=current data table();

colList = dt &amp;lt;&amp;lt; get column names( string );

For( i = 1, i &amp;lt;= N Items( colList ), i++,
	If( Left( colList[i], 50 ) == "ABC_12::ABCD_AB_ABCDEF_A_ABCDE_X_X_A1_1234_ABCD",
		Column( dt, colList[i] ) &amp;lt;&amp;lt; Substr((colList[i],50) ), // this is the part where i m stuck.
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have tried using Trim &amp;amp; Left. But it does not work. I have an idea of using "set name" to take in string after the 50th character. But must have a better way on doing this.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:54:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-i-rename-column-header-name-with-existing-string/m-p/549087#M76566</guid>
      <dc:creator>kuanaunwei</dc:creator>
      <dc:date>2023-06-10T23:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do i rename column header name with existing string?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-i-rename-column-header-name-with-existing-string/m-p/549100#M76567</link>
      <description>&lt;P&gt;You need to use &amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&amp;lt;&amp;lt; set name&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to change the name of the column&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

colList = dt &amp;lt;&amp;lt; get column names( string );

For( i = 1, i &amp;lt;= N Items( colList ), i++,
	If( Left( colList[i], 48 ) == "ABC_12::ABCD_AB_ABCDEF_A_ABCDE_X_X_A1_1234_ABCD_",
		Column( dt, colList[i] ) &amp;lt;&amp;lt; set name( Substr( colList[i], 49 ) ), // this is the part where i m stuck.
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 10:09:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-i-rename-column-header-name-with-existing-string/m-p/549100#M76567</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-09-26T10:09:59Z</dc:date>
    </item>
  </channel>
</rss>

