MathGroup Archive 2006

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

Search the Archive

Filtering Strings


Hello Everyone,

I have a 2,922 x 7 matrix called X.  If I want to extract all rows  
where the string in the second column beings with "INC", the  
following works fine:

	Select[X, StringMatchQ[#[[2]], "INC"~~__] &];

But I was wondering neither of these two work.

	Select[X, #[[2]]=="INC"~~__ &]

	Select[X,StringCases[#[[2]],"^INC"~~__] &]

Any advice would be most appreciated.

	Greg


  • Prev by Date: Re: Solving the differential equation
  • Next by Date: Finding k-clique
  • Previous by thread: Re: Count Function
  • Next by thread: Finding k-clique