Most probably no
While Swarms "act" as a single creature, they are not "treated" as a single creature, except when the subtype mandates it: HD, HP, initiative, speed, AC and Saves.
As an exception to all these things where the swarm is treated as if it was a single creature, swarms are immune to any spell that targets a specific number of creatures. While I have no proof that this is true, I think this ability is meant to represent the fact that the swarm, despite having a single AC, HP pool, and so on is still made of individuals and affecting a bunch of those will not stop the whole swarm.
While there are no rules specifically about this rare situation, I infer that the swarm should also not be immune to any spell that avoids targeting a specific number of creatures, as a Selective spell does: you have spared a few chosen individuals, which are Diminutive and therefore not big enough to be a threat (the smallest Centipede monster is Tiny), but the bulk of the swarm has been damaged.