gabriel rosenkoetter on Mon, 6 May 2002 21:00:16 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] sed help


On Mon, May 06, 2002 at 02:25:46PM -0400, Samantha wrote:
> And those chars are mailed to me along with my results.
> 
> So I do a sed search and replace (replacing the hex values with nothing) 
> like this:
> sed 's'/\\x27\\x91\\x72\\x27\\x91\\x50\\x74//g' text_file > text_file2
> 
> Nothing changes. What am I doing wrong?

You're mistaking the fact that your terminal doesn't display 8-bit
ASCII text with the highest order bit set and choosing to display
its hex value instead for each single character actual being
multiple characters. They're not.

The easiest way to make this go away is probably to use dos2unix(1),
which ships standard with Solaris. I see it on neither my NetBSD
machine nor on the Linux machines I have handy, but google says
this:

  http://www.megaloman.com/~hany/software/hd2u/

might be useful.

You can probably type high-ASCII on your workstation (using the meta
key; see the attached file for what keys turn into with meta--on the
second row of each block--and shift-meta--on the third row--active),
but piping through dos2unix(1) will probably be less pain than
rolling your own sed(1) script.

-- 
gabriel rosenkoetter
gr@eclipsed.net
` 1 2 3 4 5 6 7 8 9 0 - =
à ± ² ³ ´ µ ¶ · ¸ ¹ ° ­ ½
þ ¡ À £ ¤ ¥ Þ ¦ ª ¨ © ß «

q w e r t y u i o p [ ] \
ñ ÷ å ò ô ù õ é ï ð Û Ý Ü
Ñ × Å Ò Ô Ù Õ É Ï Ð û ý ü

a s d f g h j k l ; '
á ó ä æ ç è ê ë ì » §
Á Ó Ä Æ Ç È Ê Ë Ì º ¢

z x c v b n m , . /
ú ø ã ö â î í ¬ ® ¯
Ú Ø Ã Ö Â Î Í ¼ ¾ ¿

Attachment: pgpYGN6nj41Ev.pgp
Description: PGP signature