Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove Hard Return at End of Line 1

Status
Not open for further replies.

CCHall

IS-IT--Management
May 3, 2005
46
US
In MS Word, is there any way to remove a hard return at the end of each line, without removing the double-spacing between paragraphs?

I'm converting a text file with hard returns at the end of each line into a Word document. I have copied and pasted the text already. Any help greatly appreciated!

Thanks!
 

You can double space all lines (with or without paragraph marks) if that's what you want. Ctrl+A (to select all) and Ctrl+2 (to set double spacing).

Replacing the paragraph marks themselves may be more of an issue as, presumably, you want to retain some of them. If you need help with that, let us know how to identify the ones you want to keep. If you really want to delete them all then Ctrl+H (for the Replace Dialog), in the Find box enter "^p" (without the quotes) and hit "Replace All".

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Tony,

Thanks for your reply. What I want to do is remove the paragraph marks at the end of lines, but not at the end of paragraphs, where there would be two paragraph marks.

For example, I'd want this:

"Every minute she gets stronger," said Holmes,
glancing at the governess. "But tell me, Baynes,
who is this man Henderson?"

"Henderson," the inspector answered, "is
Don Murillo, once called the Tiger of San
Pedro."


to look like this:

"Every minute she gets stronger," said Holmes, glancing at the governess. "But tell me, Baynes, who is this man Henderson?"

"Henderson," the inspector answered, "is Don Murillo, once called the Tiger of San Pedro."
 
Hi CCHall,

You will need to do this in three passes.

1. Change two consecutive paragraph marks to some unique sequence not already in the document, say @@.

2. Change all (remaining) aragraph marks to spaces.

3. Change all @@ (back) to paragraph marks.

Using Find and Replace (Ctrl+H)

1. In Find what, enter ^p^p
In Replace with, enter @@
Hit Replace All

2. In Find what, enter ^p
In Replace with, delete the contents and leave blank
Hit Replace All

3. In Find what, enter @@
In Replace with, enter ^p
Hit Replace All

You can, if you haven't already done so, change the line spacing, either via the keys I mentioned in my last post or via Format > Paragraph > Indents and Spacing tab

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Use styles. There should not BE two paragraph marks between paragraphs.

Gerry
 
Thanks so much for the replies. Tony, you were right on the money, except that I initially forgot to put a space before the last ^p to keep words at the end of lines from running together. This is great and saved me a ton of time! Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top