Not a single button click, but it can be done via regular expressions in Notepad++ while searching/replacing in files.
Remember to fill in the Directory or select it via the 3 dots.
In find what, I've typed:
[ ]+$
left the replace with blank and added these filters for the files to be modified
*.rul;*.yml
Mark the search mode as Regular expression and check/un-check the 'In all sub-folders' as desired.
WARNING: This is very powerful and can make unwanted changes if you're not sure what you're doing, use it at your own risk. I recommend you perform a 'Find all' first to verify it's finding the right things and not including lines that could break the mod. And probably make a copy of everything before making changes, just in case.