Replace in technicolour
Mac Tip #271/29-Nov-2006
The free text editor Tex-Edit Plus can do one extraordinarily useful thing that many or most other text editors cannot: you can find and replace styled text.
That means, among other things, that you could find the word “the” and replace it with “my” using a colour such as red or green. Or, you can identify just where you’ve used a particular word by replacing it with itself, but in a different colour from the surrounding text.
Once the replace operation is complete you need only glance at the text to see which words have been changed. The coloured text jumps out and you may immediately see that all kinds of unintended replacements have been made, or, with luck, that the operation made exactly the changes you expected.
Open Tex-Edit Plus and enter some text — copy and paste this Tip perhaps.
Now call up the Find & Replace dialog from the Edit > Find menu. Enter the text to Find and the text to Replace with in the text boxes. Then click the small arrow at the right-hand end of the Replace text box and choose Color > Red. You should see that the text in the Replace with text box turns red. Now click the Replace All button.
[Click on the thumbnails for larger images.]
Tex-Edit Plus makes the replacements then puts up an alert to tell you how many replacements it made. Click OK to dismiss the alert. The replacements are displayed in red, or whatever colour you chose.
If you see problems choose Undo from the Edit menu.
Note: Tex-Edit Plus has multiple levels of Undo. That means you can undo more than just the last one operation. It can even Undo back past a Save, provided you haven’t closed the document in the meantime.
Next week: E=mc cubed.
Popularity: 6% [?]
















{ 0 comments… add one now }