Skip to main content
added 43 characters in body
Source Link
Kuba
  • 137.7k
  • 13
  • 289
  • 751

If there are no multiple positions for each insertelement we can do something like:

i = 0;
Insert[origlist, "mark", insertpositions] /. "mark" :> (++i; insertvalues[[i]]) 

(*insertposition should be sorted*)

if, there are it can be exteded easily, by making duplicates in insertelements or to make different "marks" for them.

If there are no multiple positions for each insertelement we can do something like:

i = 0;
Insert[origlist, "mark", insertpositions] /. "mark" :> (++i; insertvalues[[i]])

if, there are it can be exteded easily, by making duplicates in insertelements or to make different "marks" for them.

If there are no multiple positions for each insertelement we can do something like:

i = 0;
Insert[origlist, "mark", insertpositions] /. "mark" :> (++i; insertvalues[[i]]) 

(*insertposition should be sorted*)

if, there are it can be exteded easily, by making duplicates in insertelements or to make different "marks" for them.

Source Link
Kuba
  • 137.7k
  • 13
  • 289
  • 751

If there are no multiple positions for each insertelement we can do something like:

i = 0;
Insert[origlist, "mark", insertpositions] /. "mark" :> (++i; insertvalues[[i]])

if, there are it can be exteded easily, by making duplicates in insertelements or to make different "marks" for them.