<?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 Possible to rename all columns in a table from a list? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Possible-to-rename-all-columns-in-a-table-from-a-list/m-p/500802#M73531</link>
    <description>&lt;P&gt;Hi. &amp;nbsp;I'm wondering if there's a way to rename all columns in a table from a list without using a For loop. &amp;nbsp;I have tables with ~10k columns and using a For loop takes a lot longer than I'd like. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Details:&lt;/P&gt;&lt;P&gt;JMP Pro 16.2.0&lt;/P&gt;&lt;P&gt;Mac OS Big Sur 11.6.6&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've looked into the Recode Column Names... feature (Cols &amp;gt; Column Names &amp;gt; Recode Column Names...). &amp;nbsp;In the dialog that appears, I can then select the red down triangle and Advanced &amp;gt; Apply Mapping from Table.... &amp;nbsp; Assuming I have a table with the original and new column names, this appears to work well. &amp;nbsp;However, there doesn't appear to be a way to script this though. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also tried transposing the table, adding a new column with the new column names, and then re-transposing using the new column as the labels. &amp;nbsp;This works too, but is too slow for tables my size.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know of another clever way to do this without using a For loop?&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jun 2023 23:49:10 GMT</pubDate>
    <dc:creator>nikles</dc:creator>
    <dc:date>2023-06-10T23:49:10Z</dc:date>
    <item>
      <title>Possible to rename all columns in a table from a list?</title>
      <link>https://community.jmp.com/t5/Discussions/Possible-to-rename-all-columns-in-a-table-from-a-list/m-p/500802#M73531</link>
      <description>&lt;P&gt;Hi. &amp;nbsp;I'm wondering if there's a way to rename all columns in a table from a list without using a For loop. &amp;nbsp;I have tables with ~10k columns and using a For loop takes a lot longer than I'd like. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Details:&lt;/P&gt;&lt;P&gt;JMP Pro 16.2.0&lt;/P&gt;&lt;P&gt;Mac OS Big Sur 11.6.6&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've looked into the Recode Column Names... feature (Cols &amp;gt; Column Names &amp;gt; Recode Column Names...). &amp;nbsp;In the dialog that appears, I can then select the red down triangle and Advanced &amp;gt; Apply Mapping from Table.... &amp;nbsp; Assuming I have a table with the original and new column names, this appears to work well. &amp;nbsp;However, there doesn't appear to be a way to script this though. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also tried transposing the table, adding a new column with the new column names, and then re-transposing using the new column as the labels. &amp;nbsp;This works too, but is too slow for tables my size.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know of another clever way to do this without using a For loop?&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:49:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Possible-to-rename-all-columns-in-a-table-from-a-list/m-p/500802#M73531</guid>
      <dc:creator>nikles</dc:creator>
      <dc:date>2023-06-10T23:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to rename all columns in a table from a list?</title>
      <link>https://community.jmp.com/t5/Discussions/Possible-to-rename-all-columns-in-a-table-from-a-list/m-p/500922#M73532</link>
      <description>&lt;P&gt;One interactive way to do this, is to copy all of your new column names into the paste buffer.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1654545912292.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/43005iB8F83F804B0BA0C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1654545912292.png" alt="txnelson_0-1654545912292.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then select all columns from the Columns Panel in your data table.&amp;nbsp; I suggest that you use CNTL/a to select them all&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_1-1654546051337.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/43008i34B6758A31B12B01/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_1-1654546051337.png" alt="txnelson_1-1654546051337.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And then use CNTL/v to paste from the paste buffer to the column names&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_2-1654546150351.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/43009i43A3CDF1E1572973/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_2-1654546150351.png" alt="txnelson_2-1654546150351.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 20:11:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Possible-to-rename-all-columns-in-a-table-from-a-list/m-p/500922#M73532</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-06-06T20:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to rename all columns in a table from a list?</title>
      <link>https://community.jmp.com/t5/Discussions/Possible-to-rename-all-columns-in-a-table-from-a-list/m-p/500927#M73533</link>
      <description>&lt;P&gt;I feel like renaming columns with looping shouldn't really take that long.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("test", invisible);

For(i = 1, i &amp;lt;= 10000, i++,
	dt &amp;lt;&amp;lt; New Column(Char(i*10), values(1::10000))
);

col_names = As List((1::10000)`);
wait(1);

start = HP Time();
For Each({col_name, idx}, col_names,
	Column(dt, idx) &amp;lt;&amp;lt; Set Name(char(col_name));
);
Show((HP Time() - start) / 1e6);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Jun 2022 20:16:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Possible-to-rename-all-columns-in-a-table-from-a-list/m-p/500927#M73533</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-06-06T20:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to rename all columns in a table from a list?</title>
      <link>https://community.jmp.com/t5/Discussions/Possible-to-rename-all-columns-in-a-table-from-a-list/m-p/502065#M73566</link>
      <description>&lt;P&gt;Thanks jthi. &amp;nbsp;Yeah I have to admit, using a For loop is a lot faster than I remember. &amp;nbsp;I tried it a long time ago and recall thinking it was too slow. &amp;nbsp;Should've tried it again before asking...&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 20:19:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Possible-to-rename-all-columns-in-a-table-from-a-list/m-p/502065#M73566</guid>
      <dc:creator>nikles</dc:creator>
      <dc:date>2022-06-07T20:19:28Z</dc:date>
    </item>
  </channel>
</rss>

