Batching the job is almost impossible due the contents structure of the perfect select... I would say that Notepad++ is the best option but is is very similar that actual search and replace in that case...
I might write a small program to quickly fix that if you want. Please send me the current perfect select with spaces, just to analyze and test... but in all the cases, it should be fast.
See you