Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sample text:

I give Pirrip as my father's family name, 
on the authority of his
tombstone and my sister,--Mrs. Joe Gargery, who married the blacksmith.
As I never saw my father or my mother, 
and never saw any likeness
of either of them (for their days were long before the days of
photographs), my first fancies regarding what they were like were
unreasonably derived from their tombstones.

Most of the websites give solutions how to remove line breaks, but that removes all the formatting. What I want is to keep the ^p sign after the word tombstones, and of course the dot as well, but to remove those ^p's which are breaking the 2nd, 4th and 5th lines, after the words his, mother and likeness, and for this I cannot find a solution. Could somebody help me please?

share|improve this question
How would an automated solution or mass search/replace know only to affect the 2nd, 4th and 5th lines and leave the rest? I know of no non-manual solution that would allow you to modify selected lines only, unless something makes those lines uniquely identifiable (for example, they all have the same last character). – Karan Feb 1 '13 at 0:19
I was thinking of a string which leaves intact all the paragraph marks after the dot. Those onea I want to be kept! I want to remove only those one inside the line, which have either no punctuation sign before or eventually a blank space. – user194446 Feb 1 '13 at 9:18

Try this sequence in Word. Don't type the double quotes. Replace the hyphens with spaces (I had to use hyphens so you can see how many spaces there are)

replace all "^p^p" with "~~~" (to preserve wanted paragraph line breaks)
replace all "^p" with "-" (replace the unwanted line breaks with a space)
replace all "--" with "-" (fix any double spaces introduced by the command above)
replace all "~~~" with "^p^p" (restore the paragraph line breaks)

It would be more helpful if you could provide a link to the original example, because we can't tell the whitespace/paragraph symbols after you copy and pasted to

share|improve this answer
Yup, this is pretty much what I do to remove all line breaks within paragraphs but keep paragraphs separate. However if he wants to somehow selectively remove only a few line breaks within a paragraph and leave the rest, I don't know how that would be possible without doing it manually. – Karan Feb 1 '13 at 4:36
It's exactly what I did, manually, but anyway many thanks for the answer. – user194446 Feb 1 '13 at 9:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .