Remove trailing spaces on SQL and text files