Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: from the list select

  • To: mathgroup at smc.vnet.net
  • Subject: [mg101064] Re: from the list select
  • From: Peter Breitfeld <phbrf at t-online.de>
  • Date: Tue, 23 Jun 2009 07:04:38 -0400 (EDT)
  • References: <h1nf1q$941$1@smc.vnet.net>

terrie riley wrote:

> from this list select the person who has P in the third position
>
>
> namedata = {{"Aardsma", "David", "P"},{"Bay", "Jason", "OF"}}
>

If you want the exactly "P" at the third position use:

Cases[namedata,{_,_,"P"}]

If you want any string with a "P" in it at the third position of the
sublists use:

Cases[namedata,{_,_,_?(StringMatch[#,"*P*"]&)}]


-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de


  • Prev by Date: For loops with mathematica....
  • Next by Date: Using fractions in axis labels
  • Previous by thread: Re: from the list select
  • Next by thread: Re: from the list select