<?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: Automate concatenating data tables based on name in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Automate-concatenating-data-tables-based-on-name/m-p/693742#M87910</link>
    <description>&lt;P&gt;Also you might consider using Multiple File Import. Either combine all the tables into single table and then separate them into subsets using source column (create new column based on source column for the groups you want to have) or run MFI multiple times using wildcards * (match zero or more characters), ? (match exactly one character) and ; (separate different file name patterns) to get all single group with one run of MFI&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1698953692585.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58272iDFF61168127C9C36/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1698953692585.png" alt="jthi_1-1698953692585.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Nov 2023 19:35:46 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2023-11-02T19:35:46Z</dc:date>
    <item>
      <title>Automate concatenating data tables based on name</title>
      <link>https://community.jmp.com/t5/Discussions/Automate-concatenating-data-tables-based-on-name/m-p/693605#M87894</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to concatenate data tables based on their name.&lt;/P&gt;&lt;P&gt;For example I have 6 Data tables, and their names will be something like M1a M1b M2a M2b M3a M3b. So I want to join all M1 devices together etc. However, the M1 part will vary by name so I need the script to be able to get name and then compare part of the name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help to get started is very appreciated&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 16:04:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Automate-concatenating-data-tables-based-on-name/m-p/693605#M87894</guid>
      <dc:creator>MedianRooster10</dc:creator>
      <dc:date>2023-11-02T16:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Automate concatenating data tables based on name</title>
      <link>https://community.jmp.com/t5/Discussions/Automate-concatenating-data-tables-based-on-name/m-p/693670#M87904</link>
      <description>&lt;P&gt;Are the tables already open? If not, are they in same folder and are there other files in the folder?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/17.2/#page/jmp/data-table-messages.shtml?os=win&amp;amp;source=application#ww1919171" target="_blank" rel="noopener"&gt;&amp;lt;&amp;lt; Get Name&lt;/A&gt; can be used to get the name of data table and &lt;A href="https://www.jmp.com/support/help/en/17.2/#page/jmp/row-functions-2.shtml?os=win&amp;amp;source=application#ww7220797" target="_blank" rel="noopener"&gt;Get Data Table List()&lt;/A&gt; a list of open data tables. To compare data table names there are many options and which to use depends on your data table names (Regex is one option).&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 17:32:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Automate-concatenating-data-tables-based-on-name/m-p/693670#M87904</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-02T17:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Automate concatenating data tables based on name</title>
      <link>https://community.jmp.com/t5/Discussions/Automate-concatenating-data-tables-based-on-name/m-p/693678#M87906</link>
      <description>&lt;P&gt;Here is a script that should give you a start at putting your final script together.&amp;nbsp; It creates some sample tables to use for the example, and then finds them and matches on the first 2 characters in the name and finally concatenates them.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
// create sample data tables
For( i = 1, i &amp;lt;= 6, i++,
	New Table( "M" || Char( Mod( i, 3 ) + 1 ) || Char( i ), New Column( "D" ) );
	Data Table( "M" || Char( Mod( i, 3 ) + 1 ) || Char( i ) ) &amp;lt;&amp;lt; add rows( 1 );
	Column( Data Table( "M" || Char( Mod( i, 3 ) + 1 ) || Char( i ) ), 1 )[1] = i;
);

// Find all data tables that match Mx
concatTableList = {};
shortNameList = {};
For( i = 1, i &amp;lt;= N Table(), i++,
	If( Starts With( Data Table( i ) &amp;lt;&amp;lt; get name, "M" ),
		Insert Into( concatTableList, Data Table( i ) &amp;lt;&amp;lt; get name );
		Insert Into( shortNameList, Substr( Data Table( i ) &amp;lt;&amp;lt; get name, 1, 2 ) );
	)
);
// Find the unique key values
theKeys = Associative Array( shortNameList ) &amp;lt;&amp;lt; get keys;

// Create the concatenated tables
For Each( {key}, theKeys,
	catList = {};
	For Each( {tableName}, concatTableList,
		If( Starts With( tableName, key ),
			Insert Into( catList, tableName )
		)
	);
	If( N Items( catList ) &amp;gt; 1,
		dt = New Table( key );
		For Each( {cat}, catList, dt &amp;lt;&amp;lt; concatenate( Data Table( cat ), append to first table ) );
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Nov 2023 17:51:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Automate-concatenating-data-tables-based-on-name/m-p/693678#M87906</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-11-02T17:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Automate concatenating data tables based on name</title>
      <link>https://community.jmp.com/t5/Discussions/Automate-concatenating-data-tables-based-on-name/m-p/693742#M87910</link>
      <description>&lt;P&gt;Also you might consider using Multiple File Import. Either combine all the tables into single table and then separate them into subsets using source column (create new column based on source column for the groups you want to have) or run MFI multiple times using wildcards * (match zero or more characters), ? (match exactly one character) and ; (separate different file name patterns) to get all single group with one run of MFI&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1698953692585.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58272iDFF61168127C9C36/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1698953692585.png" alt="jthi_1-1698953692585.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 19:35:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Automate-concatenating-data-tables-based-on-name/m-p/693742#M87910</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-02T19:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Automate concatenating data tables based on name</title>
      <link>https://community.jmp.com/t5/Discussions/Automate-concatenating-data-tables-based-on-name/m-p/694161#M87926</link>
      <description>&lt;P&gt;I don't think this can work as they all come from the same excel workbook. I open this workbook and each sheet becomes a new data table. Is there a way for this to work?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 09:03:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Automate-concatenating-data-tables-based-on-name/m-p/694161#M87926</guid>
      <dc:creator>MedianRooster10</dc:creator>
      <dc:date>2023-11-03T09:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: Automate concatenating data tables based on name</title>
      <link>https://community.jmp.com/t5/Discussions/Automate-concatenating-data-tables-based-on-name/m-p/694163#M87927</link>
      <description>&lt;P&gt;If it is just a single excel file you can use Excel Import Wizard.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1699002833852.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58302i8EABC2380D35F94F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1699002833852.png" alt="jthi_0-1699002833852.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Enable "Concatenate worksheets and try to match columns" and "Create column with worksheet name when concatenating". After you have data in JMP table, create grouping column and create subsets as needed.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 09:14:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Automate-concatenating-data-tables-based-on-name/m-p/694163#M87927</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-03T09:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Automate concatenating data tables based on name</title>
      <link>https://community.jmp.com/t5/Discussions/Automate-concatenating-data-tables-based-on-name/m-p/694164#M87928</link>
      <description>&lt;P&gt;Thank You&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 09:20:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Automate-concatenating-data-tables-based-on-name/m-p/694164#M87928</guid>
      <dc:creator>MedianRooster10</dc:creator>
      <dc:date>2023-11-03T09:20:06Z</dc:date>
    </item>
  </channel>
</rss>

