How to remove multiple Enters from file with Notepad++

Before we start…

You don’t find my blog through a search engine for nothing, so I’ll immediately start with the steps to remove multiple enters from a file with text.  If you are interested you can read more about the subject under the tutorial.


Let’s remove multiple enters from a file with Notepad-Plus-Plus.

Open Notepad++ (obviously).
If you haven’t installed or used Notepad++ before, please go to paragraph Notepad-Plus-Plus (Notepad++)

The following steps are not necessarily necessary, but it shows better what we’re doing.

Go to View in the upper menu.
Click Show Symbol and select Show All Characters.

Replace multiple Enters from a file.
Replace multiple Enters from a file.

We will now literally see the Enters in the text file.
See the screenshot below the CRLF are Enters.

Replace multiple Enters from a file.
Replace multiple Enters from a file.

Now it’s a bit more clear we can start with removing Enters.

Press CTRL + H.
Replace will pop up

In tab Replace there is an option Search Mode.
Change this to Extended.

In Rich Text Editors, or programming language you’ve got several ways of adding an Enter or other Symbol in text other than pressing Enter.

For Enter you also have \r\n

Type in Find what : 
\r\n

And type in Replace with : whatever you want to replace the Enter with.
I mostly replace it with “,”. More about that in paragraph
So, when do you need to remove multiple enters from a file or row of texts?

You can also leave it blank.

Click Replace all to replace multiple Enters.
See the screenshot below.

Replace multiple Enters from a file.
Replace multiple Enters from a file.

You’ve successfully removed multiple Enters from a text file.


Notepad-Plus-Plus (Notepad++)

For more about Notepad++ you can go to their website.

For a direct download click here.


So, when do you need to remove multiple enters from a file or row of texts?

I often use it for files that customers have sent, A list of users who have a new manager, or need a new email address.

Often this is just a list of names and then I make a one-liner for PowerShell.

For example

The user list supplied:

  • Bas Wijdenes
  • Sjaak kort
  • Joost teveel
  • Chad Niceguy
  • Pamela Anderson

I want to change this in to:

$Users = "Bas Wijdenes","Sjaak kort","Joost teveel","Chad Niceguy","Pamela Anderson"

After that I can use a Foreach Loop.

Foreach ($U in $Users){
     Get-ADUser -identity $U | Set-ADUser -Manager $Manager
}

A little extra

This post contains PowerShell. Would you like to learn the basics better? I have created a new website to learn basic PowerShell in an ’emulator’ environment.
Click here to go learn Basic PowerShell.


Trying something new

I edited another client’s file and then thought, how many colleagues and fellow system engineers would do this this way? This is my way, but there will also be many others.

This gave me the idea to make a “My way” post more often so that you can learn something, or teach me of course.

Published by

Bas Wijdenes

My name is Bas Wijdenes and I work full-time as a Services Engineer. In my spare time I write about the error messages that I encounter during my work. Furthermore, I am currently occupied with Office 365, Azure infrastructure, and PowerShell for automating daily tasks.

Leave a Reply

Your email address will not be published. Required fields are marked *