Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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/ /'

share|improve this question

migrated from stackoverflow.com Oct 7 '12 at 11:09

This question came from our site for professional and enthusiast programmers.

    
What encoding does your terminal use? –  choroba Sep 10 '12 at 13:59
add comment

3 Answers

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

$ sed 's/Ď/ /g'
share|improve this answer
add comment

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.

share|improve this answer
add comment

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).

share|improve this answer
    
It worked. Thanks! –  user1660284 Sep 10 '12 at 14:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.