How to replace space with underscore in an xml file using Notepad++

It is very easy to achieve this using a regex expression. Suppose we have below in an xml file and we want to replace the space inside DisplayName node with underscore.

Sample xml –

<User id="11068577">
	<DisplayName>Dolcese Vita</DisplayName>
	<Address>Texas, US</Address>
  1. Open Notepad++
  2. Click Ctrl+H to open replace dialog box
  3. Add below in Find What:

4. Add below in Replace with:


5. Result –

<User id="11068577">
	<Address>Texas, US</Address>

Interested in Cryptocurrency. Register and start investing here

Earn a side income by affiliate marketing. Learn here how to do it.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: