Hi. I was wondering if there's a clever way to assign or append a list of items to column(s) in an existing table. For example, I have a column of names and I would like to add more names (rows) to the column from a list. The code below was one of my attempts. The problem is that instead of assigning each item in the list to its own row, rows 1-6 are each assigned the entire list.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Add Rows(6, At Start);
dt:name[1::6] = {"A", "Very", "Long", "List", "Of", "Items"};
I'm aware that I could add a list of "column = value" pairs using the << Add Rows() message, but this requires me to modify my existing column of items from {"item1", "item2", ...} to {column name = "item1", column name = "item2", ....}. Perhaps there's some command that converts the one list format to the other format? I can see no straightforward way to do this that doesn't rely on a For loop.
Also have considered just creating a temp table with the same column names, using << Set Values(list) to populate the columns, and then concatenating to the original table. For various reasons though, I'd prefer not to do it this way.
Lastly, I considered reading all the original column values back as lists, appending the new list for each column to the originals, and then just writing each entire list back to the original table. Again, not my preferred method as my lists are long.
Is there some other way I could do this? Thanks.
Using JMP Pro 17.0.0 on Mac OS Ventura 13.2.1