LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   A weird character that actually doesnt exist but visible when you do a less or vi the (https://www.linuxquestions.org/questions/programming-9/a-weird-character-that-actually-doesnt-exist-but-visible-when-you-do-a-less-or-vi-the-4175491976/)

SAbhi 01-20-2014 11:59 PM

A weird character that actually doesnt exist but visible when you do a less or vi the
 
Hi guys,

So the thing arrived when i created an XML file out of an XLS, the column those had a trailing space (*by mistake left an space there) are replaced by a character like "|" (appears in bold) and does looked like a pipe'|' .
Code:

The file has email addresses like:
<EMAILADDR>ABC@XYZ.COM</EMAIL>
and the spaces entry is like:
<EMAILADDR>ABC@XYZ.COM| </EMAIL>

when i tried search for a trailing space in the file i came across this issue as if egrep didnt showed up anything:
Code:

egrep -i 'COM[ \t]|NET[ \t]|ORG[ \t]|IN[ \t]' filename
i tried searching for a pipe character but again nothing!!
when i copied that particular line and pasted in UI editor it was just an space and nothing else there!! but visible on console :P some ghost character!!! :P
Anyone have any idea what was this behavior like and how to get rid of it??

astrogeek 01-21-2014 12:02 AM

Place the cursor on it in vim command mode and type ga to see what it is (shown at bottom of vi window).

SAbhi 01-21-2014 01:56 AM

Just figured it out ""it seeems the xls to xml conversion have translated some color code or hyperlink to that one:

Code:

grep --color='auto' -P -n "[\x80-\xFF]" <XML-Name>
does it all for me.

Thanks @astrogeek

NevemTeve 01-21-2014 04:05 AM

Note: hex viewer is your friend (Midnight Command has a built-in: mcview <filename>; then F4)

SAbhi 01-21-2014 07:38 PM

Thats something new, will try that. Thanks @NevemTeve


All times are GMT -5. The time now is 05:10 PM.