Utility to clean up P4, PP files?

I have been installing some older content and running into the annoying "duplicate" materials in P4 and PP format. And one also had P5. I was wondering if there was a utility to delete all P4 related files if PP ones exist, and any P4 or PP related ones if P5 ones exist?
Edit: Sorry, for DAZ Studio 4.7+
Post edited by argel1200 on
Comments
For Poser or DS? If Poser which version? Python changed between P7 and P8 and again between P8 and P9. Scripts that work up through P7/Pro don't always work in P8 or P9 (even uncompiled ones).
Sorry, for DAZ Studio 4.7+. Good to know about Poser though (tempted to install it for better Vue integration)