Background
Somehow I found myself with numerous NUL Characters in my text file; which coincidentally is a PowerShell Script (ps1) file.
Sample Contents
Here is what my file looks like:
Address
Notepad++
Let us address using Notepad++
Review whether special symbols are being shown
Use menu items – “View” \ “Show Symbol”
Confirmed that we are not set to Show Special symbols; interpreted to mean this is the actual file contents.
Choose Search and Replace
- Choose the menu items “Search” \ “Replace”
- In the Replace Dialog do the following
- In the “Find What” entry box, enter \x00
- Make sure that the “Replace with” entry box is left empty
- In the “Search Mode” group-box, select “Extended (\n, \r, , \x…)“
- Click on the “Replace All” button
- Magically, all the
will be gone
- Select the “Close” button to exit the “Replace” dialog
Listening
This problem really bugged me and had me thinking and listening to Monica:
Monica – Don’t take it personal(just one of them days)
https://www.youtube.com/watch?v=a9ZTiymoC5A
Hopefully next time this befalls me, I will remember I burnt a few hours on it and was all morose, but was able to find a solution (at the end).
Obviously, stealing lines from “The Best Exotic Marigold Hotel“.
Quotes
The Best Exotic Marigold Hotel
“Everything will be alright in the end so if it is not alright it is not the end.”
“The only real failure is the failure to try, and the measure of success is how we cope with disappointment.”