I have a text file that is processed by a third party. They told me the file is invalid because it contains a non-printable character. What’s the best way to find the non-printable character as my normal text editors won’t display it. I would prefer a windows, dos, or powershell based solution.
Share
Option #1 – Show All Characters
You can download Notepad++ and open the file there. Then, go to the menu and select
View->Show Symbol->Show All Characters. All characters will become visible, but you will have to scroll through the whole file to see which character needs to be removed.Unfortunately, Notepad++ will automatically convert line endings according to your
Edit->EOL Conversionselection, so it won’t help if your non-printable characters are CR or LF.Option #2 – TextFX Zap Non-printable Chars
Alternatively, you could install the TextFX plugin from SourceForge, and use
TextFX->TextFX Characters->Zap all non-printable characters to #. This will replace some non-printable characters with a pound sign, but not CR or LF.Option #3 – Remove BOM Encoding
Lastly, you could use Notepad++, and use
Encoding->Convert to UTF8 without BOM. This will remove non-printable characters which occasionally causes issues with certain renderers (VSO).