MathGroup Archive 2009

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

Search the Archive

Re: from the list select


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