Join lines (Ctrl-J), sort of
Posted: Fri Dec 07, 2001 4:33 am
I often get text files with line feed characters at the end of each line and a blank line (i.e., a line feed character only) to signify a new paragraph.
I know I can highlight a paragraph and use "Join lines" command (Ctrl-J) to remove the line feeds from within a single paragraph. However, if I mark the entire document (e.g., using Ctrl-A), a Ctrl-J will combine all the paragraphs into one long paragraph. I don't want that.
Is there an easy way to remove the line feeds from *within* all the paragraphs without losing the paragraph themselves? Another way of stating it is to remove all line feed characters if they are immediately preceded and succeeded by a non-line feed character; if you get two (or more I suppose) line feeds in a row, leave them alone.
Thanks for help.
I know I can highlight a paragraph and use "Join lines" command (Ctrl-J) to remove the line feeds from within a single paragraph. However, if I mark the entire document (e.g., using Ctrl-A), a Ctrl-J will combine all the paragraphs into one long paragraph. I don't want that.
Is there an easy way to remove the line feeds from *within* all the paragraphs without losing the paragraph themselves? Another way of stating it is to remove all line feed characters if they are immediately preceded and succeeded by a non-line feed character; if you get two (or more I suppose) line feeds in a row, leave them alone.
Thanks for help.