More workaround fun
Yes this is still a lit blog, but coworkers and I keep running into—and solving—really annoying problems. Here’s this afternoon’s…
You ever try to copy PDF text into another document—into Word, a web page, etc.—but find you’ve got a ton of breaks in the middle of lines? As in…
You ever try to copy PD
F text into another document—into
Word, a web page, etc.—but find you’ve
got a ton of breaks in the middle of lines?
Here’s how you can get rid of those breaks without all deleting the paragraph breaks you want to keep.
1. Copy the text into Microsoft Word
2. Hit Crtl-H to open the Find/Replace dialogue box
(Note that ^p is Word’s code for a paragraph break)
3. Type ^p into the Find field and ^p^p into the Replace field
Now we have four paragraphs breaks where actual paragraphs are, and two paragraphs breaks where messed up lines are. We have to do this because when we ultimately delete the unwanted breaks, we can’t just say “replace ^p with nothing” because that will delete every break, running separate paragraphs together. In fact, we now need an odd number of one and an even number of the other…
4. Type ^p^p^p^p (four of them) into the Find field and ^p^p^p^p^p (five of them) in the Replace field
Now there are an odd number of paragraph breaks (5) where actual paragraphs are, and an even number (2) where the unwanted line breaks are.
5. Type ^p^p into the Find field and nothing in the Replace field
Because the messed up line breaks had an even number of paragraph breaks (2), they now all disappear. One break for actual paragraph breaks remains.
6. Type ^p into the Find field and ^p^p in the Replace field
Now there’s a full line between the paragraphs, and we’re done!



