MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Inserting Blank Lists

  • To: mathgroup at smc.vnet.net
  • Subject: [mg68263] Re: Inserting Blank Lists
  • From: "sashap" <pavlyk at gmail.com>
  • Date: Mon, 31 Jul 2006 03:45:17 -0400 (EDT)
  • References: <eahsid$op4$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Bruce,

How about

In[5]:=
Insert[L,{},Table[{k},{k,2,Length[L]}]]

Out[5]=
{{a,b},{},{c,d},{},{e,f}}

Oleksandr Pavlyk,
Wolfram Research


Bruce Colletti wrote:
> Re Mathematica 5.2.
>
> The code below inserts a null list between L-elements:
>
> L={{"a","b"},{"c","d"},{"e","f"}};
> Most@Flatten[Map[{#,{}}&,L],1]
>
> Out[9]=
> {{a,b},{},{c,d},{},{e,f}}
> 
> What is a shorter way to do this?  Thankx.
> 
> Bruce


  • Prev by Date: need to make a special function
  • Next by Date: Re: Replacing Numbers in a List
  • Previous by thread: Re: Inserting Blank Lists
  • Next by thread: Directories and Subdirectories