Find and Replace Tips – Special Characters
September 28th, 2005Finding special characters is a useful way to clean up a document. The special characters can be added from the Special button list or directly as codes.
See the Find and Replace Tips – Formatting for the general process. The only difference is that you enter the codes instead of text.
For example, suppose you wanted to turn part of a letter from a block style with a blank line between paragraphs to an indented paragraph with a regular space between paragraphs. The process is to find the paragraph separators (2 paragraph marks) and replace them with a paragraph mark and a tab. The paragraph mark ends the paragraph and the tab begins the next one.
- Select the portion of the letter to change.
- Click into the Find field. Enter two Paragraph mark codes. Either select Paragraph mark from the Special button menu two times, or type ^p^p (lowercase p).
- In the Replace field, enter a single Paragraph mark code and a tab code (^t).
- Replace All will affect just the selected text.
Another common problem is getting mailing lists back into a format that is mail mergable. For example, suppose you’ve gotten a list formatted as follows:
John Doe
123 East Street
Anytown, MA 00001
Sally Smith
345 West Street
Yourtown, CT 00002
Each of these lines ends with a paragraph mark (^p code) and each record is separated by an additional paragraph mark. The solution is to use intermediate replacement text to get rid of the paragraph separators, then turn each line of the address into a tab separated value:
- Replace ^p^p with a pattern that is not likely to be in the text. I like @#@ since it is easy to type and not at all common.
- Replace ^p with a tab character, ^t.
- Replace @#@ with a paragraph mark.
This will convert your list into a tab-delimited file, easily used by Word or imported into Excel, Access, etc. If you plan to export it, make sure to save the file as a text file to remove extraneous Word codes.
If you have a mix of 3 and 4 line addresses, as is more common, this is a little trickier. I end up importing it into Excel and using a set of text functions to parse the text as well as to break the City, State, and Zipcode lines into separate fields. But that is another tip.
Leave a Reply
You must be logged in to post a comment.