Subscribe Bookmark RSS Feed
jay_holavarri

Community Trekker

Joined:

Mar 18, 2016

Script to Insert Column(s) into the Middle of a Table

Finally checked to see if someone had already posted something like this and didn't see it. It's an irritant to me (maybe not a rational one) that you have to use >Cols > Add Multiple Columns... dialog to simply add a column in the middle of a table. This script mimics Excel's long-time approach: select a number of columns, click a command to insert that same number of columns adjacent to the selected columns.

I have this script pegged in my Cols menu (via the menu customization tool).

dt=current datatable();

col=dt<<get selected columns;

nc=nitems(col);

dt<<add multiple columns("boo",nc,after(col[nc]),character);

Article Labels
Article Tags