Community
    • Login

    Ctrl-J (join lines) replaces LF with space

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 2 Posters 117 Views 1 Watching
    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.
    • DougK.AZD Offline
      DougK.AZ
      last edited by

      I have a private key in pem format that is split into multiple lines by line feeds. I wanted to concatenate those lines into a single line.

      Pasted the key text into a new tab, selected the lines and issued a Ctrl-J. This resulted in a single line, but each LF was replaced by a space.

      This is in v8.9.6.4 (64-bit) on Win 11.

      1 Reply Last reply Reply Quote 0
      • guy038G Offline
        guy038
        last edited by guy038

        Hello, @dougk.az and All,

        I suppose that using this simple regex replacement, below, should work !

        • Open your text in N++

        • Move back at the very beginning of your file

        • Open the Replace dialog ( Ctrl + H )

        • Uncheck all box options

        • FIND \r\n?

        • REPLACE Leave EMPTY

        • Check the Wrap around option

        • Select the Regular expression search mode

        • Click, once, on the Replace All button

        Here you are !


        To verify that all your lines are just concatenated, without any char in between, simply use the ¶ icon of the Toolbar. All the LF characters are preserved !

        Best Regards,

        guy038

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors