If you pipe a console command, which colorizes console output, such as rspec or some rake tasks, to a file and you open it in a text editor, you will see a lot of color codes, such as
ESC[35m mingled with rest of the file content. These can make reading the file quite hard. Fortunately, you can easily remove this codes with a simple Find and Replace operation in Sublime Text 2. Just follow these steps:
- Open the file in Sublime Text.
- Find -> Replace
- Enable searching by regular expression (Shortcut Alt+R on Ubuntu)
- Find What:
- Replace With - just leave empty.
- Click Replace All.