Washington Apple Pi

A Community of Apple iPad, iPhone and Mac Users

Son of E-Mail Droppings:

Converting E-mail Into Formatted Text

© 2001 Washington Apple Pi Journal Staff

Washington Apple Pi Journal, reprint information

(See also "E-mail Droppigns")

Jon Thomason, in the accompanying article, tells you how to create E-mail compatible text from a formatted document created in a word processor. He originally wrote this as a message on the Pi's bulletin board, the TCS, and then E-mailed the message to the Journal's editorial staff. After receiving the E-mail message, the editorial staff was faced with an equal but opposite task: taking an E-mail message and formatting it in a word processor prior to sucking it up into a page layout package.

Fortunately, our unofficial motto is "Semper Gumby," which translates from the original Navy Latin as "Aways flexible." Our tool for the task was Microsoft Word 2001, part of Office:mac 2001, because we'd just installed it and because we wanted to see if our old tried-and-true techniques (tried in older versions of Word) still worked.

E-mail messages are ASCII (American Standard Code for Information Exchange) text, so we didn't have to worry about funky characters. But we did have to worry about carriage returns at the end of every line, and extra spaces in odd places.

In older versions of Word, CMD-H was the keyboard shortcut for Replace, and Word 2001 continues this peculiar custom. It would seem that CMD-F would be more logical, but this brings up the Find command that just finds things; you can't replace anything. CMD-H allows you to search for spaces &emdash; just type in the space &emdash; or special characters. You can search for a tab by typing caret-T (^t) or a carriage return by searching for caret-P (^p).

Here are the steps used to reformat Jon's message:

Step 1: use Word's Indent button to indent any paragraphs that should be indented. Jon "indented" things with spaces, but these will be removed later.
  • Step 2: make sure that all paragraphs are separated by at least two carriage returns. If they aren't (they were), add a carriage return between paragraphs.

    Step 3: position the cursor at the start of the document. Search for three carriage returns in a row (^p^p^p) and replace them with two (^p^p). Repeat this exercise until Word says it made zero replacements.

    Step 4: at this point all paragraphs will have two carriage returns between them, and only two. Now search for double carriage returns (^p^p) and replace them with a bullet (• -- produced with Option-8).

    Step 5: at this point all remaining carriage returns will be at the ends of lines, and these need to be removed. Search for carriage returns (^p) and replace them with spaces.

    Step 6: the text is very difficult to read at this point, so search for bullets (•) and replace them with two carriage returns (^p^p). You should now have some nice looking paragraphs again.

    Step 7: next we need to remove spaces at the start of lines, such as Jon's "indented" paragraphs. You remove spaces at the start of lines by searching for, and replacing, spaces after carriage returns, so search for a carriage return and space (^p ) and replace with just a carriage return (^p). Repeat this until Word reports zero replacements.

    Step 8: finally, search for all doubled spaces and replace them with single spaces. Repeat until Word reports zero replacements.

  • This makes more sense once you try it a few times. In addition to Jon's article, this exercise also comes in handy when you want to reformat badly mangled E-mail jokes. While we used Word to do such editing, most other word processors have similar functions. About the only tricky part is discovering how a particular word processor handles searching for carriage returns.