Character Purifier

Home --> Useful Scripts --> Character Purifier

The Script

Taking a side in the holy war on the usage of space vs tab characters in source code, I prefer spaces. Also, every time I see a \r character in a source file, it hurts. And, I don't like to see files that end with ~.

The script replaces all tab characters with 4 space characters and removes all '\r' characters (in all files ending with .h, .cpp, or .py in the current working directory and all subdirectories). It also removes all files ending with ~ in the current working directory and all subdirectories. Use at your own risk.

To run the script, remove the .txt extension and enter the following command: