Filtering Strings
- To: mathgroup at smc.vnet.net
- Subject: [mg65486] Filtering Strings
- From: Gregory Lypny <gregory.lypny at videotron.ca>
- Date: Wed, 5 Apr 2006 06:55:25 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
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