• Login
Community
  • Login

LINE JOINING WITH MULTIPLE PARAGRAPHS

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 5 Posters 257 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    SRAK
    last edited by Jan 16, 2025, 4:57 AM

    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.

    M A M 3 Replies Last reply Jan 16, 2025, 6:53 AM Reply Quote 0
    • M
      Mark Olson @SRAK
      last edited by Jan 16, 2025, 6:53 AM

      @SRAK

      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.

      1 Reply Last reply Reply Quote 0
      • A
        Alan Kilborn @SRAK
        last edited by Jan 16, 2025, 11:57 AM

        @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).

        1 Reply Last reply Reply Quote 2
        • M
          mkupper @SRAK
          last edited by mkupper Jan 17, 2025, 9:32 AM Jan 17, 2025, 8:44 AM

          @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 by Ctrl+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.

          P 1 Reply Last reply Jan 17, 2025, 2:06 PM Reply Quote 0
          • P
            PeterJones @mkupper
            last edited by Jan 17, 2025, 2:06 PM

            @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”
            1 Reply Last reply Reply Quote 1
            5 out of 5
            • First post
              5/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors