Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find non-printable character in text file [closed]

Tags:

file

binary

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.

like image 577
Bill Martin Avatar asked Dec 15 '11 16:12

Bill Martin


People also ask

How do I find hidden characters in a text file?

Go to View Menu > Select Show Symbol > Select Show All Characters . It displays all hidden characters in the opened file.

How can I see non-printable characters?

To show non-printing characters in Word, click the “Home” tab in the Ribbon. Then click the “Show/Hide Non-Printing Characters” button in the “Paragraph” button group. The face of the button looks like the paragraph mark (“¶”).

How do I find a non Unicode character?

To identify the Non Unicode characters we can use either Google Chrome or Mozilla firefox browser by just dragging and dropping the file to the browser. Chrome will show us only the row and column number of the .


1 Answers

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 Conversion selection, 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).

like image 107
Daniel Gabriel Avatar answered Oct 03 '22 01:10

Daniel Gabriel