<?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 to remove a user-defined text from all columns or all column names? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-remove-a-user-defined-text-from-all-columns-or-all-column/m-p/748512#M92913</link>
    <description>&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;I will try the script you show which is more flexible with more customized requirements.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Apr 2024 02:27:30 GMT</pubDate>
    <dc:creator>Fruit325</dc:creator>
    <dc:date>2024-04-23T02:27:30Z</dc:date>
    <item>
      <title>How to remove a user-defined text from all columns or all column names?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-a-user-defined-text-from-all-columns-or-all-column/m-p/748458#M92891</link>
      <description>&lt;P&gt;For example, I have a table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Fruit325_0-1713802525393.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63531i5EA78CB62ABA6F2C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Fruit325_0-1713802525393.png" alt="Fruit325_0-1713802525393.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;1. All column names contain "CHA/", how could I remove it quickly and leave it like "Temp""Pressure" and "Flow"? In the real case, I have hundreds of columns containing "CHA/".&lt;/P&gt;&lt;P&gt;2. How could I make the first row as the column names?&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Is there any way to remove "CHA/" from all the cells in the table?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 16:19:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-a-user-defined-text-from-all-columns-or-all-column/m-p/748458#M92891</guid>
      <dc:creator>Fruit325</dc:creator>
      <dc:date>2024-04-22T16:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove a user-defined text from all columns or all column names?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-a-user-defined-text-from-all-columns-or-all-column/m-p/748465#M92892</link>
      <description>&lt;P&gt;1. You can use Recode Column Names to clean those&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_2-1713803596597.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63534iD23CBFEE37DF2AAA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_2-1713803596597.png" alt="jthi_2-1713803596597.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1713803577441.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63533i01029A1C418767C9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1713803577441.png" alt="jthi_1-1713803577441.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Top row to column names&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1713803499897.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63532i90AC315E6A48BF29/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1713803499897.png" alt="jthi_0-1713803499897.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;3. Yes, either by scripting or using Search dialog and replace all&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_4-1713803665982.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63536i0740AB38DC25997F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_4-1713803665982.png" alt="jthi_4-1713803665982.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_3-1713803625420.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63535i5CEA21C665C35E66/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_3-1713803625420.png" alt="jthi_3-1713803625420.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 16:34:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-a-user-defined-text-from-all-columns-or-all-column/m-p/748465#M92892</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-04-22T16:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove a user-defined text from all columns or all column names?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-a-user-defined-text-from-all-columns-or-all-column/m-p/748467#M92894</link>
      <description>&lt;OL&gt;
&lt;LI&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;provided a great interactive solution however, you may want to consider using a simple script that will change the column names that begin with CHA/&amp;nbsp;&lt;/LI&gt;
&lt;/OL&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

nameList = dt &amp;lt;&amp;lt; get column names( string );
&lt;BR /&gt;
For Each( {col}, nameList,
	If(
		Starts With(
			col,
			"CHA/",
			Column( dt, col ) &amp;lt;&amp;lt; set name( Substr( col, 5 ) )
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;1. If your data is input from a csv or txt file, you can use the input wizard to specify to use row 1 as the column headers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;2. Or you can use a simple script to do the work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

nameList = dt &amp;lt;&amp;lt; get column names( string );

For Each( {col}, nameList,
	column( dt, col) &amp;lt;&amp;lt; set name( col[1] )
);

dt &amp;lt;&amp;lt; delete rows(1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;3.&amp;nbsp; The search the columns for the value "CHA"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;1.&amp;nbsp; If the values are in what needs to be a numeric column, just by changing he column to be numeric will delete CHA from the cells in the column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;2.&amp;nbsp; Or this simple script should do it&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

nameList = dt &amp;lt;&amp;lt; get column names( string );

For Each( {col}, nameList,
	Try( Column( dt, col )[dt &amp;lt;&amp;lt; get rows where( col == "CHA" )] = "" )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Apr 2024 17:08:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-a-user-defined-text-from-all-columns-or-all-column/m-p/748467#M92894</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-04-22T17:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove a user-defined text from all columns or all column names?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-a-user-defined-text-from-all-columns-or-all-column/m-p/748511#M92912</link>
      <description>&lt;P&gt;Thank you! It worked and its very helpful!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 02:26:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-a-user-defined-text-from-all-columns-or-all-column/m-p/748511#M92912</guid>
      <dc:creator>Fruit325</dc:creator>
      <dc:date>2024-04-23T02:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove a user-defined text from all columns or all column names?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-a-user-defined-text-from-all-columns-or-all-column/m-p/748512#M92913</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;I will try the script you show which is more flexible with more customized requirements.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 02:27:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-a-user-defined-text-from-all-columns-or-all-column/m-p/748512#M92913</guid>
      <dc:creator>Fruit325</dc:creator>
      <dc:date>2024-04-23T02:27:30Z</dc:date>
    </item>
  </channel>
</rss>

