<?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 Use Only Part of a Row of Data as Column Header? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-use-only-some-columns-from-a-row-as-column-headers/m-p/18509#M16862</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess I should have mentioned I was assuming you wanted to make a button out of it. Script &amp;gt; Button &amp;gt; Efficient repetition.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 May 2016 16:51:40 GMT</pubDate>
    <dc:creator>tsandidge</dc:creator>
    <dc:date>2016-05-12T16:51:40Z</dc:date>
    <item>
      <title>How to use only some columns from a row as column headers?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-only-some-columns-from-a-row-as-column-headers/m-p/18505#M16858</link>
      <description>&lt;P&gt;As part of a database export I get a file with some headers that I can use straight away ( from Experiment ID to DOE_FILE_ID) but then I get some 'generic' headers of C1 to C255&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="11523_Capture.JPG" style="width: 1439px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/3051iB23625EAA7879657/image-size/medium?v=v2&amp;amp;px=400" role="button" title="11523_Capture.JPG" alt="11523_Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;what I need to do is to select all of the first row of data which has C1 to C255 as their headers and replace it with the information from the selected first row&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so C1 would be changed to Sample, C2 would be OLD Sample Identifier etc. For every table I get this information will be different so I can't use a Find &amp;amp; Replace to do this.I cannot change the way that this data is imported using preferences as it is from a database.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many regards&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 21:56:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-only-some-columns-from-a-row-as-column-headers/m-p/18505#M16858</guid>
      <dc:creator>d_barnett</dc:creator>
      <dc:date>2018-02-13T21:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Use Only Part of a Row of Data as Column Header?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-only-some-columns-from-a-row-as-column-headers/m-p/18506#M16859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To start out with,&lt;/P&gt;&lt;PRE&gt;&lt;P&gt;colNames = dt &amp;lt;&amp;lt; get column names;&lt;/P&gt;&lt;P&gt;For( i = 1, i &amp;lt;= N Items( colNames ), i++,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Column( i ) &amp;lt;&amp;lt; set name( Column( i )[1] )&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;// delete the first row&lt;/P&gt;&lt;P&gt;dt &amp;lt;&amp;lt; select rows( 1 );&lt;/P&gt;&lt;P&gt;dt &amp;lt;&amp;lt; delete rows;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;This will load all the column names into &lt;CODE&gt;colNames&lt;/CODE&gt;, loop over the list, and then set each name to its first element.&lt;/P&gt;&lt;P&gt;For your case, I would use a regex filter to loop over the column names, adding the columns beginning with &lt;CODE&gt;"^C\d"&lt;/CODE&gt; to a separate list.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;CODE&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;colNames = dt &amp;lt;&amp;lt; get column names;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/CODE&gt;&lt;P&gt;badCols = {};&lt;/P&gt;&lt;P&gt;For( i = 1, i &amp;lt;= N Items( colNames ), i++,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cname = Column( colNames&lt;I&gt; ) &amp;lt;&amp;lt; get name;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If( !(Is Missing( Regex( cname, "^C\d" ) )),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Insert Into( badCols, colNames&lt;I&gt; )&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;Show( badCols );&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;To then rename those specific columns, you can do the following:&lt;/P&gt;&lt;PRE&gt;&lt;P&gt;For( i = 1, i &amp;lt;= N Items( badCols ), i++,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cname = Column( badCols&lt;I&gt; ) &amp;lt;&amp;lt; get name;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Column( cname ) &amp;lt;&amp;lt; set name( Column( cname )[1] );&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;I'm still working on selecting the first cells of the relevant columns and deleting that cell (the column names), and you may also then want to delete the last row if it is empty, but this is a good place to start. I'll update when I figure that last piece out, but you may beat me to it.&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 16:22:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-only-some-columns-from-a-row-as-column-headers/m-p/18506#M16859</guid>
      <dc:creator>tsandidge</dc:creator>
      <dc:date>2016-05-12T16:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Use Only Part of a Row of Data as Column Header?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-only-some-columns-from-a-row-as-column-headers/m-p/18507#M16860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you're okay doing it interactively, you can use copy and paste.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select the cells in the first row that have the column names. Then select the columns in the columns panel on the left and paste them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See &lt;A href="http://blogs.sas.com/content/jmp/2010/07/24/column-names-got-you-down-try-this/"&gt;this blog post&lt;/A&gt; for a more complete explanation, with a video.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Jeff&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 16:40:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-only-some-columns-from-a-row-as-column-headers/m-p/18507#M16860</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2016-05-12T16:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Use Only Part of a Row of Data as Column Header?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-only-some-columns-from-a-row-as-column-headers/m-p/18508#M16861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another option is to use the &lt;A _jive_internal="true" href="https://kvoqx44227.lithium.com/docs/DOC-6145" target="_blank"&gt;Column Names Utility Addin&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select the columns you want to move up and then click move up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="11530_Screenshot 2016-05-12 12.43.05.png" style="width: 812px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/3055i25303E5D19ADF566/image-size/medium?v=v2&amp;amp;px=400" role="button" title="11530_Screenshot 2016-05-12 12.43.05.png" alt="11530_Screenshot 2016-05-12 12.43.05.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 02:38:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-only-some-columns-from-a-row-as-column-headers/m-p/18508#M16861</guid>
      <dc:creator>stan_koprowski</dc:creator>
      <dc:date>2016-10-19T02:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Use Only Part of a Row of Data as Column Header?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-only-some-columns-from-a-row-as-column-headers/m-p/18509#M16862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess I should have mentioned I was assuming you wanted to make a button out of it. Script &amp;gt; Button &amp;gt; Efficient repetition.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 16:51:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-only-some-columns-from-a-row-as-column-headers/m-p/18509#M16862</guid>
      <dc:creator>tsandidge</dc:creator>
      <dc:date>2016-05-12T16:51:40Z</dc:date>
    </item>
  </channel>
</rss>

