<?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 I need to reorder my columns in an efficient manner (there are 57 instances of 5 groups each (57 x 5) = 285 columns to rearrange) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/I-need-to-reorder-my-columns-in-an-efficient-manner-there-are-57/m-p/673582#M86104</link>
    <description>&lt;P&gt;Hi - I have 5 groups of 57 columns (5 x 57) that I need to rearrange so that likes are with likes.&amp;nbsp; I've cut and pasted examples of the columns from my JMP table.&amp;nbsp; The columns names have five sets of prefixes (again, each of these groups has 57 column names corresponding to chemical compounds):&lt;/P&gt;&lt;P&gt;1 - RES_VALUES_&lt;/P&gt;&lt;P&gt;2 - RES_TEXT_&lt;/P&gt;&lt;P&gt;3 - DETECT_FLAG_&lt;/P&gt;&lt;P&gt;4 - RL_&lt;/P&gt;&lt;P&gt;5 - DILUTION_FACTOR_&lt;/P&gt;&lt;P&gt;Each of these is followed by a suffix corresponding to the chemical compound name (there are 57 of these).&lt;/P&gt;&lt;P&gt;I want to have each chemical compound name grouped together.&amp;nbsp; So, for example, one chemical compound, say "4:2 FTS", would be listed in the column order as follows:&amp;nbsp; &amp;nbsp;RES_VALUE_4:2 FTS, RES_TEXT_4:2 FTS, DETECT_FLAG_4:2 FTS, RL_4:2 FTS, DILUTION_FACTOR_4:2 FTS.&amp;nbsp; &amp;nbsp; This sequence would be repeated for each chemical compound.&amp;nbsp; What I would end up with is a table that I can easily explore, where the relevant info for each compound is together.&amp;nbsp; The first 5 columns would be 4:2 FTS.&amp;nbsp; The second 5 would be the next compound, 6:2 FTS.&amp;nbsp; And so on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Is there an efficient way to do this rather than drag and drop?&amp;nbsp; Thanks in advance!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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="learning_JSL_0-1693614265876.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/56183iBC70C0C3C63642A7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="learning_JSL_0-1693614265876.png" alt="learning_JSL_0-1693614265876.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="learning_JSL_1-1693614332210.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/56184i28B717B026E46BDB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="learning_JSL_1-1693614332210.png" alt="learning_JSL_1-1693614332210.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="learning_JSL_2-1693614358413.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/56185i763F9B6CD781B8B6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="learning_JSL_2-1693614358413.png" alt="learning_JSL_2-1693614358413.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="learning_JSL_3-1693614378748.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/56186i68DC1A35251725F6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="learning_JSL_3-1693614378748.png" alt="learning_JSL_3-1693614378748.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="learning_JSL_4-1693614399502.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/56187iB139864FFD4D3F55/image-size/medium?v=v2&amp;amp;px=400" role="button" title="learning_JSL_4-1693614399502.png" alt="learning_JSL_4-1693614399502.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 02 Sep 2023 00:39:17 GMT</pubDate>
    <dc:creator>learning_JSL</dc:creator>
    <dc:date>2023-09-02T00:39:17Z</dc:date>
    <item>
      <title>I need to reorder my columns in an efficient manner (there are 57 instances of 5 groups each (57 x 5) = 285 columns to rearrange)</title>
      <link>https://community.jmp.com/t5/Discussions/I-need-to-reorder-my-columns-in-an-efficient-manner-there-are-57/m-p/673582#M86104</link>
      <description>&lt;P&gt;Hi - I have 5 groups of 57 columns (5 x 57) that I need to rearrange so that likes are with likes.&amp;nbsp; I've cut and pasted examples of the columns from my JMP table.&amp;nbsp; The columns names have five sets of prefixes (again, each of these groups has 57 column names corresponding to chemical compounds):&lt;/P&gt;&lt;P&gt;1 - RES_VALUES_&lt;/P&gt;&lt;P&gt;2 - RES_TEXT_&lt;/P&gt;&lt;P&gt;3 - DETECT_FLAG_&lt;/P&gt;&lt;P&gt;4 - RL_&lt;/P&gt;&lt;P&gt;5 - DILUTION_FACTOR_&lt;/P&gt;&lt;P&gt;Each of these is followed by a suffix corresponding to the chemical compound name (there are 57 of these).&lt;/P&gt;&lt;P&gt;I want to have each chemical compound name grouped together.&amp;nbsp; So, for example, one chemical compound, say "4:2 FTS", would be listed in the column order as follows:&amp;nbsp; &amp;nbsp;RES_VALUE_4:2 FTS, RES_TEXT_4:2 FTS, DETECT_FLAG_4:2 FTS, RL_4:2 FTS, DILUTION_FACTOR_4:2 FTS.&amp;nbsp; &amp;nbsp; This sequence would be repeated for each chemical compound.&amp;nbsp; What I would end up with is a table that I can easily explore, where the relevant info for each compound is together.&amp;nbsp; The first 5 columns would be 4:2 FTS.&amp;nbsp; The second 5 would be the next compound, 6:2 FTS.&amp;nbsp; And so on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Is there an efficient way to do this rather than drag and drop?&amp;nbsp; Thanks in advance!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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="learning_JSL_0-1693614265876.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/56183iBC70C0C3C63642A7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="learning_JSL_0-1693614265876.png" alt="learning_JSL_0-1693614265876.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="learning_JSL_1-1693614332210.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/56184i28B717B026E46BDB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="learning_JSL_1-1693614332210.png" alt="learning_JSL_1-1693614332210.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="learning_JSL_2-1693614358413.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/56185i763F9B6CD781B8B6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="learning_JSL_2-1693614358413.png" alt="learning_JSL_2-1693614358413.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="learning_JSL_3-1693614378748.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/56186i68DC1A35251725F6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="learning_JSL_3-1693614378748.png" alt="learning_JSL_3-1693614378748.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="learning_JSL_4-1693614399502.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/56187iB139864FFD4D3F55/image-size/medium?v=v2&amp;amp;px=400" role="button" title="learning_JSL_4-1693614399502.png" alt="learning_JSL_4-1693614399502.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Sep 2023 00:39:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/I-need-to-reorder-my-columns-in-an-efficient-manner-there-are-57/m-p/673582#M86104</guid>
      <dc:creator>learning_JSL</dc:creator>
      <dc:date>2023-09-02T00:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: I need to reorder my columns in an efficient manner (there are 57 instances of 5 groups each (57 x 5) = 285 columns to rearrange)</title>
      <link>https://community.jmp.com/t5/Discussions/I-need-to-reorder-my-columns-in-an-efficient-manner-there-are-57/m-p/673607#M86106</link>
      <description>&lt;P&gt;Here is a little script that I think will do what you want.&amp;nbsp; It orders the columns as you suggested, plus it groups each of the compounds into separate column groups.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);
groupList = {"RES_VALUE","RES_TEXT", "DETECT_FLAG", "RL", "DILUTION_FACTOR" };

// The comment lines below, when uncommented will create a small example data table
// that was used to test the code
/*compList = {"4:2 FTS", "6:2 FTS", "ADONA" };
New Table("Example");
for each({group}, groupList,
	for each({comp},compList,
		New Column(group || " " || comp)
	)
);*/

dt = current data table();

// Find all of the different compounds.  This is done by using the "RES_VALUE" columns
// and stripping off the compound names from each of them
compList = {};
For( i=1,i&amp;lt;=N Cols(dt), i++,
	colName = column(dt,i)&amp;lt;&amp;lt;get name;
	if(contains( colName,"RES_VALUE")==1,
		insert into(compList,substr(colName,11))
	)
);

// Order each of the Compound columns together
For Each( {comp}, compList,
	varList = {};
	For Each( {group}, groupList,
		insert into(varList, group || " " || comp)
	);
	dt &amp;lt;&amp;lt; select columns( varList);
	dt &amp;lt;&amp;lt; Move Selected Columns( To last );
	dt &amp;lt;&amp;lt; group columns( comp, varList);
	
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 02 Sep 2023 04:21:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/I-need-to-reorder-my-columns-in-an-efficient-manner-there-are-57/m-p/673607#M86106</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-09-02T04:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: I need to reorder my columns in an efficient manner (there are 57 instances of 5 groups each (57 x 5) = 285 columns to rearrange)</title>
      <link>https://community.jmp.com/t5/Discussions/I-need-to-reorder-my-columns-in-an-efficient-manner-there-are-57/m-p/673651#M86111</link>
      <description>&lt;P&gt;Thanks Jim!&amp;nbsp; It worked beautifully - simple and concise!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I really appreciate your help.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Sep 2023 12:13:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/I-need-to-reorder-my-columns-in-an-efficient-manner-there-are-57/m-p/673651#M86111</guid>
      <dc:creator>learning_JSL</dc:creator>
      <dc:date>2023-09-02T12:13:08Z</dc:date>
    </item>
  </channel>
</rss>

