cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
Souvik
Level I

How to delete/close all data table with zero rows from workspace all at once?

 
3 REPLIES 3
David_Burnham
Super User (Alumni)

Re: How to delete/close all data table with non zero rows from workspace at once?

Does that mean you want to keep tables open if they have zero rows?  Not sure how to do that without a script, but generally if I want to close all my tables then I go to one of my tables and from the menu select Window>Close All Data Tables.

-Dave
Souvik
Level I

Re: How to delete/close all data table with non zero rows from workspace at once?

Hello David, sorry there was a typo in the question, I want to delete/remove all the tables that are there in my workspace which has zero rows; I mean close all the empty tables at once.

Actually I have developed a script which is generating about 100 tables and some tables (about 30 suppose) will not contain any data hence empty. I want to remove those tables from workspace in order to make it look clean and also easy to navigate between tables.

I would like to know if any jsl command is there to do the operation ?
txnelson
Super User

Re: How to delete/close all data table with non zero rows from workspace at once?

There exist multiple previous discussions on this.  But, here is a simple piece of code that will do what you want:

Names Default To Here( 1 );

For( i = N Table(), i >= 1, i--,
	If( N Rows( Data Table( i ) ) == 0,
		Close( Data Table( i ), nosave )
	)
);
Jim