Thursday, August 30, 2007

100 Removing Carriage Returns to Post text to your blog without uneven line lengths

How many times have you tried to copy and paste text from your word processing program into your blog, only to find when you publish the post that it looks horrible, displaying uneven line lengths, weird line breaks and carriage returns, the formatting all screwed up?

If you are like me, you probably wasted a lot of time going through the text hitting delete wherever the text erroneously skipped to the next line and trying to make it all come out right.

Here is a procedure for getting rid of those annoying hidden carriage returns and line breaks that really works great, thanks to Bobbi Kerlin, Ph.D. in her guide to using NUD.IST4 Classic to conduct Computer-Aided Qualitative Data Analysis (CAQDA). (You can read her description and view pictures of the process here: http://kerlins.net/bobbi/research/nudist/documents/unevenlines.html) The technique she describes works using both Microsoft Word and OpenOffice.org (open office instructions are here: http://openoffice.blogs.com/openoffice/2005/12/finding_and_rep.html)

(coders, you can find a java code to automate this here: http://jennifermadden.com/javascript/stringEscape.html)

Steps:
1. Open your text in Word.

2. Go to format/reveal formatting

3. Under options (in the window on the lower right) tick the "show all formatting marks" checkbox.

4. Go to Edit/Replace (ctl H if you use the keyboard).

5. Using the replace tab, under "find what" put in ^p^p to find all instances of double paragraph marks (these are usually the true paragraph marks you want to keep) and replace with $$ or && or some other character that is unlikely to be found in your document.

6. Your document will suddenly lose all its formatting but don't worry. Now we have to replace the single paragraph marks (the annoying ones that screw up our line lengths on our blog post) with a single empty space. So now find ^p and replace with a space (i.e. hit the space bar once, moving the cursor in the replace with field one space to the right).

7. Now do another find for the $$ or && marks you put in, and re-replace them with ^p^p (double paragraph marks). When you do that the formatting will all re-appear as you wanted it.

8. Now cut and paste this text into your blog post. When you publish it should look okay!

P.S.: If you have messed up text IN YOUR BLOG, go to edit post, do a select all, copy the text and paste it into Microsoft Word. Now, when you see it, the paragraph marks have been replaced by little back arrows. There will be two back arrows (indicating carriage returns I guess) for legitimate paragraphs, and one where there is a funky uneven line length carriage return. To do a replace for these and other unusual characters you can do as I did and search through the "special" tab at the bottom of the find and replace window. On my computer (running Windows XP) it turns out the code for those arrows is ^l which stands for "manual line break".
Replace the double ^l^l with $$ or && as you did ^p^p before (step 5), and then single ^l with a single space as in step 6. Then follow steps 7 and 8 and you are done.

Hope this helps and saves you a ton of time that can be better spent trying to figure out how to end poverty and suffering in the face of the greed and ignorance of people who have too much and still think they need more!

No comments: