Delete cases nested list
- To: mathgroup at smc.vnet.net
- Subject: [mg42767] Delete cases nested list
- From: "The Leddons" <jleddon1 at comcast.net>
- Date: Fri, 25 Jul 2003 05:08:13 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hello,
I have 2 lists, lis1 and lis2, I want to compare to each other for the
purpose of deleting sublists of lis1 that have elements matching those
in lis2. I tried this:
lis1 = {{2, 3, 4, 5, 6, 7, C1}, {2, 3, 4, 5, 6, 71, B6}, {1, 2, 3, 4,
5, 6, C11}, {4, 5, 6, 7, 8, 7, C4}, {23, 3, 2, 5, 6, 7, M2}, {2, 3, 9,
5, 6, 71, B3}};
lis2 = {C11, B6, B3};
lis3 = DeleteCases[lis1, {x_lis2}, {2}]
What I want is:
lis3 = {{2, 3, 4, 5, 6, 7, C1}, {4, 5, 6, 7, 8, 7, C4}, {23, 3, 2, 5, 6, 7, M2}};
However, this didn't work. Note that I want to delete all cases containing B.
Any ideas?
Cheers,
Debbie