Symbol 001E in a box on a Linux terminal

0

When reading a Windows log file in a Linux terminal, I see a strange symbol “001E”

enter image description here

How can I replace it by space? Maybe something like sed -e 's/010e/ /'

Ivan

Posted 2012-09-10T13:53:24.383

Reputation: 101

What encoding does your terminal use? – choroba – 2012-09-10T13:59:04.377

Answers

1

If you see these four hexadecimal digits in a box, it means your terminal's font does not cover that character. The hexadecimal notation tells you which character it is: U+001E, which is in the control character range — 1E is ^^ (i.e. Ctrl-^).

If you want to replace it with a space, you can use

sed -e 's/\x1E/ /g' <input-file >output-file

or

tr '\036' <input-file >output-file

(tr only accepts octal).

Gilles 'SO- stop being evil'

Posted 2012-09-10T13:53:24.383

Reputation: 58 319

0

To replace LATIN CAPITAL LETTER D WITH CARON, do this:

$ sed 's/Ď/ /g'

user95605

Posted 2012-09-10T13:53:24.383

Reputation:

0

Using this answer as a reference:

CHARS=$(python -c 'print u"\u001E".encode("utf8")')
sed 's/['"$CHARS"']//g' < /tmp/utf8_input.txt > /tmp/ascii_output.txt

I am not sure what is your character though... The screenshot suggests it is 0x001e but you have mentioned 0x010e. Whichever it is, you can just change the script above as needed.

bcelary

Posted 2012-09-10T13:53:24.383

Reputation: 101