MathGroup Archive 2005

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

Search the Archive

Re: splitting sublists

  • To: mathgroup at smc.vnet.net
  • Subject: [mg58039] Re: splitting sublists
  • From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
  • Date: Thu, 16 Jun 2005 07:19:33 -0400 (EDT)
  • Organization: Uni Leipzig
  • References: <d8rjme$isb$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

lst = {{3, 1, 4, "x", 1, 5, 9, 2, "x"}, {6, 5, 
"x", 3, 5, "x", 8, 9, "x"}};

lst //. {a___, "x", b___} :> {{a}, b} //. 
{lst_List, iseq__Integer} :>
                                              Sequence 
@@ {lst, {iseq}}

Regards

  Jens

<hrocht at mail15.com> schrieb im Newsbeitrag 
news:d8rjme$isb$1 at smc.vnet.net...
> hi
> how to split the sublists inside a bigger list 
> wherever we find "x"
> letter
> {{3,1,4,"x",1,5,9,2,"x"},{6,5,"x",3,5,"x",8,9,"x"}}
> the results will be:
>
> {{{3,1,4},{1,5,9,2}},{{6,5},{3,5},{8,9}}}
>
> best regards
> and thanks for this great group
> anton
> 



  • Prev by Date: Re: For Loop and Array related
  • Next by Date: Re: For Loop and Array related
  • Previous by thread: Re: splitting sublists
  • Next by thread: Re: splitting sublists