<?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 Problems working with data tables created by Multiple File Import in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Problems-working-with-data-tables-created-by-Multiple-File/m-p/190640#M40941</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Basically what I am trying to do is have a script that will run "Multiple file import" on several folders and concatenate the results into a single table. Here is my current script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;path = ""; // (actual folder path redacted, pretend something that works is here)
fid = Files In Directory(path);
// Remove all the files, just leaving the folders
for(f=NItems(fid), f&amp;gt;=1, f--, if(IsFile(path||"/"||fid[f]), RemoveFrom(fid, f)));
vn = 0;
print(N Items( fid ));
For( LV1 = 1, LV1 &amp;lt;= N Items( fid ), LV1++,
	print(LV1);
	If(
		contains(fid[LV1],"EU")
	,
		vn++;
		VAReus = contains(fid[LV1],"EU");
		STRrn = substr(fid[LV1],VAReus,9);
		show(fid[LV1],STRrn);
		STRfold = path||char(fid[LV1]);
		DT1 = Multiple File Import(
			&amp;lt;&amp;lt;Set Folder(
				STRfold
			),
			&amp;lt;&amp;lt;Set Name Filter( "*.jpg" ),
			&amp;lt;&amp;lt;Set Name Enable( 1 ),
			&amp;lt;&amp;lt;Set Size Enable( 0 ),
			&amp;lt;&amp;lt;Set Date Enable( 0 ),
			&amp;lt;&amp;lt;Set Add File Name Column( 0 ),
			&amp;lt;&amp;lt;Set Add File Size Column( 0 ),
			&amp;lt;&amp;lt;Set Add File Date Column( 0 ),
		) &amp;lt;&amp;lt; Import Data;
		wait(0.1);
		DTT1 = DT1 &amp;lt;&amp;lt; Transpose(columns(:Picture), Output Table("DTT1"), Link to original data table( 0 ));
		wait(0.1);
		try(Close(DT1, nosave););
		DTT1:Label[1] = STRrn;
		wait(0.1);
		If(
			vn == 1
		,
			DTM = DTT1 &amp;lt;&amp;lt; Subset( All rows, Selected columns only( 0 ), Output Table("DTM"), Link to original data table( 0 ));
			try(Close(DTT1, nosave););
		,
			stop();
			DTM &amp;lt;&amp;lt; Concatenate(DTT1, append to first table);
			wait(0.1);
			try(Close(DTT1, nosave););
		);
	);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;By the time it gets to the stop command i've hit several problems:&lt;/P&gt;&lt;P&gt;1. none of the close data table commands have worked&lt;/P&gt;&lt;P&gt;2. the&amp;nbsp;&lt;CODE class=" language-jsl"&gt;DTT1:Label[1]&lt;/CODE&gt;change has changed the label column in the DTM table for some reason&lt;/P&gt;&lt;P&gt;3. when running certain parts of the script after, eg highlighting DTT1 and DTM, the log seems to think these are the right data tables&lt;/P&gt;&lt;P&gt;4. trying to run the close command without try() gived the error:&amp;nbsp;invalid argument in access or evaluation of 'Close' , Close/*###*/(DT1, nosave)&lt;/P&gt;</description>
    <pubDate>Mon, 01 Apr 2019 15:39:25 GMT</pubDate>
    <dc:creator>david707</dc:creator>
    <dc:date>2019-04-01T15:39:25Z</dc:date>
    <item>
      <title>Problems working with data tables created by Multiple File Import</title>
      <link>https://community.jmp.com/t5/Discussions/Problems-working-with-data-tables-created-by-Multiple-File/m-p/190640#M40941</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Basically what I am trying to do is have a script that will run "Multiple file import" on several folders and concatenate the results into a single table. Here is my current script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;path = ""; // (actual folder path redacted, pretend something that works is here)
fid = Files In Directory(path);
// Remove all the files, just leaving the folders
for(f=NItems(fid), f&amp;gt;=1, f--, if(IsFile(path||"/"||fid[f]), RemoveFrom(fid, f)));
vn = 0;
print(N Items( fid ));
For( LV1 = 1, LV1 &amp;lt;= N Items( fid ), LV1++,
	print(LV1);
	If(
		contains(fid[LV1],"EU")
	,
		vn++;
		VAReus = contains(fid[LV1],"EU");
		STRrn = substr(fid[LV1],VAReus,9);
		show(fid[LV1],STRrn);
		STRfold = path||char(fid[LV1]);
		DT1 = Multiple File Import(
			&amp;lt;&amp;lt;Set Folder(
				STRfold
			),
			&amp;lt;&amp;lt;Set Name Filter( "*.jpg" ),
			&amp;lt;&amp;lt;Set Name Enable( 1 ),
			&amp;lt;&amp;lt;Set Size Enable( 0 ),
			&amp;lt;&amp;lt;Set Date Enable( 0 ),
			&amp;lt;&amp;lt;Set Add File Name Column( 0 ),
			&amp;lt;&amp;lt;Set Add File Size Column( 0 ),
			&amp;lt;&amp;lt;Set Add File Date Column( 0 ),
		) &amp;lt;&amp;lt; Import Data;
		wait(0.1);
		DTT1 = DT1 &amp;lt;&amp;lt; Transpose(columns(:Picture), Output Table("DTT1"), Link to original data table( 0 ));
		wait(0.1);
		try(Close(DT1, nosave););
		DTT1:Label[1] = STRrn;
		wait(0.1);
		If(
			vn == 1
		,
			DTM = DTT1 &amp;lt;&amp;lt; Subset( All rows, Selected columns only( 0 ), Output Table("DTM"), Link to original data table( 0 ));
			try(Close(DTT1, nosave););
		,
			stop();
			DTM &amp;lt;&amp;lt; Concatenate(DTT1, append to first table);
			wait(0.1);
			try(Close(DTT1, nosave););
		);
	);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;By the time it gets to the stop command i've hit several problems:&lt;/P&gt;&lt;P&gt;1. none of the close data table commands have worked&lt;/P&gt;&lt;P&gt;2. the&amp;nbsp;&lt;CODE class=" language-jsl"&gt;DTT1:Label[1]&lt;/CODE&gt;change has changed the label column in the DTM table for some reason&lt;/P&gt;&lt;P&gt;3. when running certain parts of the script after, eg highlighting DTT1 and DTM, the log seems to think these are the right data tables&lt;/P&gt;&lt;P&gt;4. trying to run the close command without try() gived the error:&amp;nbsp;invalid argument in access or evaluation of 'Close' , Close/*###*/(DT1, nosave)&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 15:39:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Problems-working-with-data-tables-created-by-Multiple-File/m-p/190640#M40941</guid>
      <dc:creator>david707</dc:creator>
      <dc:date>2019-04-01T15:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problems working with data tables created by Multiple File Import</title>
      <link>https://community.jmp.com/t5/Discussions/Problems-working-with-data-tables-created-by-Multiple-File/m-p/190705#M40960</link>
      <description>&lt;P&gt;This is tough to debug without a file structure available to read in a bunch of files. The method that I typically use, when I need to do something similar to this, is to use the Recursive option on the File in Directory() function, and then read in one file at a time, concatenate that file to the master, and then continue on to the next file.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 00:48:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Problems-working-with-data-tables-created-by-Multiple-File/m-p/190705#M40960</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-04-02T00:48:34Z</dc:date>
    </item>
  </channel>
</rss>

