I feel this should be so simple but I am failing to make any progress
So time to ask the experts
So what I am looking for it to leave ABC-XYZ as is
But replace ABC--XYZ or ABC----XYZ etc to ABC-XYZ
What I need to do is replace spaces with hyphens and then trim the hyphens
So sometimes at the moment I have ABC - DEF and ABC DEF
I want both those to become ABC-DEF
What I was going to do was change the spaces to hyphens and then trim the hyphens in a multi stage process but I have a lot of picture files so the less passes it needs the better