Inserting multiple columns to a list at once

 Inserting multiple columns to a list at once

I’m working with a nested list (labeled here as allEntries) and I’m trying to insert some additional columns. My list has 12 categories, each category has a different number of entries, and each entry starts with 15 elements.

I’m trying to add 3 more elements, and currently I’m doing it one element at a time using table and insert. For instance the first thing I want to add is the day of the week explicitly

allEntries  = 
Table[
    Insert[
        allEntries[[j, i]],
        DateString[{allEntries[[j, i, 2]], {"Month", "Day", "Year", "Hour", "Minute"}}, "DayName"],
         3],
{j, 1, Length[shapes]},
{i, 1, Length[allEntries[[j]]]}
];

Here j goes from 1 to 12, and then i goes from 1 to the number of entries in the category (anywhere from a few hundred to a few 10s of thousands). I’m simply converting the date into a simple day of the week to make it easier to select later on, and I want this added at position 3.

This works fine, but I’m doing it two more times to add other data in the same fashion, and it seems like there should be a way to add this in one step.

Let’s block ads! (Why?)

Recent Questions – Mathematica Stack Exchange