LINE JOINING WITH MULTIPLE PARAGRAPHS
-
Hi,
I found quite some info on line join command “Ctrl+J”. However, i need help on the following.I had copied a large amount text from another website and when pasted in N++ the lines are wrapped in the wrong place for all paras and also the line length in only about 45-50 chars long.
When I do "Ctrl+J for line join, that joins “all the text in all paragraphs” into one big para with no space or line breaks or any other differentiation. I want the paragraphs to remain as is but the lines in individual paragraphs joined to form 80 char long lines.
I intend to then copy that text into word and later make a PDF from work to save it as a nice document.
Kindly provide necessary inputs.
-
Your request is too vague for me (and I suspect most other forum-goers) to give you much help. Please follow this template for search/replace questions and show us examples of how you would like to transform your file.
-
@SRAK said:
Notepad++ can provide some limited help here.
I want the paragraphs to remain as is
Select each “paragraph” individually before issuing the Ctrl+j.
In case this is not clear: select, Ctrl+j, select, Ctrl+j, etc.the lines in individual paragraphs joined to form 80 char long lines.
Simplest way: Size your Notepad++ window so that it is approximately 80 characters wide when you look at your data. Select the paragraph or paragraphs to affect and then issue the split lines command (or Ctrl+i).
-
@SRAK Notepad++'s
Ctrl+J
won’t do what you want but I think you can do it with a regular expression.First remove all trailing blanks using
Search:[ \t]+$
Replace:(blank or nothing)
Then do
Search:(<?.)\R(?=.)
Replace:\x20
The first search /replace makes sure there are no lines that are all blanks. The second joins consecutive lines with a single space. This will convert your paragraphs long lines.
Notepad++ used to have a plugin called TextFX that had a word re-wrapper thing that worked closer to what you want. TextFX’s word re-wrapper was aware of paragraphs divided by blank lines meaning someone could do a select-all and the re-wrapper would essentially do a
Ctrl+J
followed byCtrl+I
on each of the paragraphs. It did not join the paragraphs together.I stopped using TextFX a few years ago and don’t know if any modern replacements have a similar feature.
-
@mkupper said in LINE JOINING WITH MULTIPLE PARAGRAPHS:
I stopped using TextFX a few years ago and don’t know if any modern replacements have a similar feature.
Looking at our TextFX Replacement FAQ from a couple years ago, the NppTextFX2 plugin hadn’t yet gotten the TextFX Edit submenu (which includes the Rewrap comand) to work. However, that FAQ does say
Rewrap == this can be implemented in PythonScript¹: this “rewrap script”