Hello

I am trying to combine Tables togethers

for example I would like to insert column before the column 2 of the table

   [table =. 3 3 $  <"0 i.9

┌─┬─┬─┐

│0│1│2│

├─┼─┼─┤

│3│4│5│

├─┼─┼─┤

│6│7│8│

└─┴─┴─┘


   [column =. 3 1$ (<,'0')

┌─┐

│0│

├─┤

│0│

├─┤

│0│

└─┘



the solution I have found at the moment is the following:


   [tab2 =. 2|."1  table

┌─┬─┬─┐

│2│0│1│

├─┼─┼─┤

│5│3│4│

├─┼─┼─┤

│8│6│7│

└─┴─┴─┘


   [tab3 =. column ,"1 1    tab2

┌─┬─┬─┬─┐

│0│2│0│1│

├─┼─┼─┼─┤

│0│5│3│4│

├─┼─┼─┼─┤

│0│8│6│7│

└─┴─┴─┴─┘


Result:

   2|."1 tab3

┌─┬─┬─┬─┐

│0│1│0│2│

├─┼─┼─┼─┤

│3│4│0│5│

├─┼─┼─┼─┤

│6│7│0│8│

└─┴─┴─┴─┘


Can you suggest me a better solution ?

Thanks

Paolo
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to