Find and replace styles

Image (c) Paramount Pictures
If you’ve used a consistent set of styles to markup a manuscript, you can simplify this job by using a feature of MS Word, Open Office and several other word processors that allows you to Find and Replace based on styles and special characters.
For instance, you can:
- Search for the Heading 1 style and Replace it with the Heading 2 style
- Search for the Manual Page Break special character and Replace it with the word ‘Chapter’ formatted in Heading 1 style
To show you how it’s done, we’ll use MS Word 2010 to replace a Manual Page Break special character (which Amazon requires for Kindle conversion) with the word ‘CHAPTER ’ formatted in Heading 1 style (as required by the Smashwords conversion service).
If you’re using a different word processor, it will operate similarly to the example. For instance, if you’re using Open Office, you can access these advanced Find and Replace features from Edit > Find & Replace then choose More Options.
Advanced text editing and transformation
Word processors have plenty of power for cleaning up and re-formatting manuscripts and it can all be done in an environment editors and authors are familiar with. But as projects become more complex and volumes increase, advanced users will soon run up against the limits of word processing tools.
When they reach this stage, they will need the extra features that come with programming editors. These are special editors that have been optimized for programming. They include many features needed to manipulate text.
Here are a few things these advanced text editors do.
- Operate on plain text files rather than word processing documents. This means Word documents must first be saved as HTML.
- Operate across multiple files. This is a real time-saver since you’ll typically have to split a manuscript into multiple chapter files.
- Syntax highlighting. Many of these editors will highlight the tags and other elements in HTML, CSS and other languages.
- Advanced search and replace features, including regular expressions. Regular expressions is a whole language devoted to finding and transforming text. It has a lot of power but it’s technical and there’s a fairly steep learning curve to fully exploit it.
Some popular text editors used for ebook production
Here are a few popular text editors, some free and some paid.
Macintosh only
- BBEdit (http://www.barebones.com/products/bbedit/)
- TextWrangler (http://www.barebones.com/products/textwrangler/)
- TextMate (http://macromates.com)
Windows
- Notepad++ (http://notepad-plus-plus.org)
- jEdit (http://www.jedit.org)
- PowerGREP (http://www.powergrep.com)
In addition, advanced features can be found in some programs such as the EPUB editor Sigil or design software like InDesign. We look at some of these in the section on production.
Regular Expressions Cheat Sheet
If you want a quick ‘cheat sheet’ of some commonly-used regular expressions, visit this page on Cheatography.
Resources
Find out more about this topic on our Digital Publishing 101 useful resources site.