![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to replace any char with newline char. | mightysam | Shell Programming and Scripting | 5 | 09-18-2008 05:15 PM |
| Please Help me with this ..High Priority! | balaji_gopal | Shell Programming and Scripting | 0 | 05-28-2008 12:14 PM |
| How to display first 7 char of grep results? | kthatch | UNIX for Dummies Questions & Answers | 8 | 04-04-2007 10:00 PM |
| Sun: High kernel usage & very high load averages | lorrainenineill | UNIX for Advanced & Expert Users | 4 | 02-06-2006 09:32 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi -
I have file which contains high bit unicode chars like © etc.. How can I do grep to find out lines which contain copyright symbol © I tried using grep \x{00A9} grep \x\{00A9\} Thanks- Last edited by ayyo1234; 02-09-2008 at 09:22 AM. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Any suggestion
Any suggestion ?
I need to use grep only.. |
|
#3
|
|||
|
|||
|
Try this:
grep '©' filename |
|
#4
|
|||
|
|||
|
How you will type '©' in unix ??? I am not sure whether you can type it in unix...
In windows I can type it using 'Alt+0169'.. |
|
#5
|
|||
|
|||
|
Quote:
'©' in Unix is: Press Shift+Alt+0 simultaneously. |
|
#6
|
|||
|
|||
|
Thanks for your reply.
However, I am not able to type © in unix I tried shift+alt+0... |
|
#7
|
|||
|
|||
|
POSIX grep does not look past a nul character. 00A9 is the unicode sequence number for what you want. The first byte is 00 - the nul character.
grep will not do what you need. Cosnider wiritng something in C - reads in short integers (2 byte integers) from the file. Compare each one with 169. When you find 169 that is character offset in the file where the symbol is. You are probably better off using a Windows editor. Found a version og grep from mkssoftware that claims to support unicode: grep, egrep, fgrep -- match patterns in a file GNU grep has a -U switch to support binary character files (UTF-16, unicode, etc) Last edited by jim mcnamara; 02-11-2008 at 01:07 PM. |
|||
| Google The UNIX and Linux Forums |