Results 1 to 9 of 9
Dear Experts
We have 'SNOWMAN' UTF-8 character in our files which i need to replace with doublequotes (").
The UTF-8 hex value for 'SNOWMAN' is 0xE2 0x98 0x83 (e29883) , ...
- 02-24-2010 #1Just Joined!
- Join Date
- Feb 2010
- Posts
- 6
Replacing SNOWMAN with double quotes using sed
Dear Experts
We have 'SNOWMAN' UTF-8 character in our files which i need to replace with doublequotes (").
The UTF-8 hex value for 'SNOWMAN' is 0xE2 0x98 0x83 (e29883) , I have written the commands like this but it is not working .........
sed -i 's/\x0xE2 0x98 0x83/"/g' FileName
Any help will be much appreciated
Thanks
- 02-25-2010 #2Just Joined!
- Join Date
- Feb 2010
- Posts
- 6
Any help please..........
Thanks
- 02-25-2010 #3Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Try:
Code:sed -i "s/'SNOWMAN'/\"SNOWMAN\"/g" FileName
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 03-01-2010 #4Just Joined!
- Join Date
- Feb 2010
- Posts
- 6
Hi
I was still unable resolve this issue, I am not looking to replace the word SNOWMAN but the symbol snowman which is ☃ , whose unicode is 2603.
How do I replace this symbol in a file with single quotes.
Any help will be much appreciated .
Thanks very much in advance
- 03-01-2010 #5Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Ok. I get it now. The "snowman" symbol in unicode you want to replace with standard ascii double quotes. Correct?
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 03-02-2010 #6Just Joined!
- Join Date
- Feb 2010
- Posts
- 6
Yes Please.............thanks
- 03-02-2010 #7Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
I'm still looking into that. Are you sure about the hex value of the symbol embedded in the file(s)? Also, are the bytes in the file(s) in hex x26 and x03 in that order?
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 03-02-2010 #8Just Joined!
- Join Date
- Feb 2010
- Posts
- 6
Hi
Thanks for your commitment , time and reply
The hex value of snow man is 0xE2 0x98 0x83 , and when i see this in unix i will see some thing like 'a' with ^ and . on the top of letter ' a' ..........sorry i cann't paste exact character that i see on the linux screen.........but when i copy paste that charcter and try to replace this character it is getting replacing which is nothing but xE2 is getting replaced but the other part x98 and x83 are not getting replaced because these are non-printable charcters and when i try to delete the non printable characters it is deleting all the spaces, tabs and new line charcaters from the file...........
Thanks
- 03-04-2010 #9Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Have patience - I'm still deciding on the best way to deal with this. I'll try to respond later today or tomorrow, work permitting.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote