The forum has a post-queue to prevent spammers: the post-editor told you this as you were creating your post. You don’t have to post it twice just because you didn’t see it show up visibly. I used moderator power to only approve the first version you posted, not the second version,
Please use the </> on the post toolbar for marking your example text as “code”, which makes sure that the forum puts it in the box and doesn’t interpret text as formatting codes. I used moderator power to add in the markdown for you, so that people could read your text to help you, but in the future, you need to be the one to make your post readable.
I cannot tell whether you really meant for there to be blank lines between each line of text, or if that was some artifact of the way you entered the text. You need to clarify this, otherwise the answers we give might not work for your actual data.
I cannot tell whether you really intended for the word PASSWORD to be squished together with the username’s value in the first possible output format; if that’s what you want, it seems like a horrible idea to me, so I will assume you don’t actually want it that way.
From a data security standpoint, you should never store passwords in plain text. If you are, you are either asking hackers to steal your list of passwords, or you are a hacker who has already hacked some site. The first is highly insecure, the second is immoral and likely illegal. I will assume this is just an example set of data, where you are trying to learn how to do that, and that you are neither practicing insecure behavior nor criminal behavior.
Possible solution:
FIND = (?-s)^(USERNAME=.*)\R+(PASSWORD=.*)$
REPLACE = $1 $2
SEARCH MODE = Regular Expression
REPLACE ALL
This should work whether or not you have the extra blank lines between each line.
quick explanation:
FIND:
REPLACE:
$1 = use the contents of group1 $2 = use the contents of group2 since the newline sequences between the groups weren’t in any group, they won’t end up in your replacementThe references below – especially the User Manual’s regex docs – will help you learn more about regular-expression searching.
----
Useful References Please Read Before Posting Template for Search/Replace Questions Formatting Forum Posts Notepad++ Online User Manual: Searching/Regex FAQ: Where to find other regular expressions (regex) documentation