cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
dadawasozo
Level V

Not able to close table in a for loop

Hi,

I want to use a for loop to keep import multiple files and close it after concatenate. the import multiple and concatenate is working but not the close(). I tried wait(), still not working. Not sure what I did wrong. 

dt1 = New table();
dir = {"dir1","dir2","dir3"}; //can have many dirs
for(i=1, i<= N Items(dir), i++,
	dt[i] = Multiple File Import(
	<<Set Folder( path1||"\" || dir[i] ),
	<<Set Show Hidden( 0 ),
	<<Set Subfolders( 0 ),
	<<Set Name Filter( "*.csv*;" ),
	<<Set Name Enable( 1 ),
	<<Set Add File Name Column( 1 ),
	<<Set Add File Size Column( 0 ),
	<<Set Add File Date Column( 0 ),
	<<Set Import Mode( "CSVData" ),
	<<Set Charset( "Best Guess" ),
	<<Set Stack Mode( "Stack Similar" ),
	<<Set CSV Has Headers( 0 ),

	) << Import Data,


dt1 << Concatenate(dt[i],Append to first table( 1 ));

close (dt[i],nosave); //this is the step dont seems taken effect. table not close
);

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Not able to close table in a for loop

If I remember correctly Multiple File Import returns a list and if that is the case you will have to loop over that list while closing the data tables.

-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: Not able to close table in a for loop

If I remember correctly Multiple File Import returns a list and if that is the case you will have to loop over that list while closing the data tables.

-Jarmo

Recommended Articles