Is it possible to replace part of a molecule according to a template?

We have a large commercially purchased library that we are trying to put through our registration system, and the structure checker is kicking out a large number of them.  It is possible to auto-clean some, but the results are ugly.  On review of the structures that are failing, it is clear that the issues are mostly in the template that was used for enumeration, that is the errors fall out in groups of 10 compounds that all have the exact same structural problem within a group.  We have already tried a variety of Pilot "cleaning" components with no success.

I know that it is possible to align molecules to a particular substructure, I am wondering if there is a method to not only align the molecule but also to essentially cut and paste the substructure out of the input molecule and replace it with the substructure from the template?  It would be a big help as we could then manually edit only one structure and be able to apply the fix automatically to the rest. 

If this is not possible, alternate suggestions for accomplishing the same end are welcome. 

Best,

Jennie