Ctrl-J (join lines) replaces LF with space
-
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.
-
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 aroundoption -
Select the
Regular expressionsearch mode -
Click, once, on the
Replace Allbutton
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 theLFcharacters are preserved !Best Regards,
guy038
-
-
Thanks guy for the hint. There are no CR’s in this file, only LF’s, so an “extended” search on \n replacing with nothing did the trick!
-
Hi; @dougk.az and All,
First of all, I need to apologize :
Firstly, my search regex was erroneous. My bad ! I should have written :
FIND
\r?\nREPLACE
Leave EMPTY
Secondly, in the last sentence of my previous post, I did a typo because I wanted to mean :
To verify that all your lines are just concatenated, without any char in between, simply use the
¶icon of the Toolbar. All theFFcharacters are preserved !
Note that the regex syntax
\r?\nsearch, either, for :-
The two consecutive chars
\rand\n -
The character
\nonly
So, this new formulation, in regex mode, should work either !
BR
guy038
-
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