grep high bit char


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users grep high bit char
# 1  
Old 02-09-2008
MySQL grep high bit char

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 12:22 PM..
# 2  
Old 02-09-2008
Any suggestion

Any suggestion ?

I need to use grep only..
# 3  
Old 02-09-2008
Try this:

grep '©' filename
# 4  
Old 02-09-2008
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  
Old 02-10-2008
Quote:
Originally Posted by ayyo1234
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'..

'©' in Unix is:

Press Shift+Alt+0 simultaneously.
# 6  
Old 02-11-2008
Thanks for your reply.

However, I am not able to type © in unix

I tried shift+alt+0...
# 7  
Old 02-11-2008
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 04:07 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

Which version of Windows Vista to install with a product key? 32-bit or 64-bit?

Hello everyone. I bought a dell laptop (XPS M1330) online which came without a hard drive. There is a Windows Vista Ultimate OEMAct sticker with product key at the bottom case. I checked dell website (here) for this model and it says this model supports both 32 and 64-bit version of Windows... (4 Replies)
Discussion started by: milhan
4 Replies

2. Shell Programming and Scripting

awk statement to grep (bit involved)

Hellow: I have the following data. id1 xxx xxx xxx id1 xxxx xxx xxx id2 xxx xxx xxx id2 xxxx xxx xxx id2 In my awk script which reads the file containing the above data I have the following code: myline=<inputdata> which is shown above What I am trying to find out is how may... (5 Replies)
Discussion started by: wincrazy
5 Replies

3. Shell Programming and Scripting

How to handle 64 bit arithmetic operation at 32 bit compiled perl interpreter?H

Hi, Here is the issue. From the program snippet I have Base: 0x1800000000, Size: 0x3FFE7FFFFFFFF which are of 40 and 56 bits. SO I used use bignum to do the math but summing them up I always failed having correct result. perl interpreter info, perl, v5.8.8 built for... (0 Replies)
Discussion started by: rrd1986
0 Replies

4. Red Hat

apache high cpu load on high traffic

i have a Intel Quad Core Xeon X3440 (4 x 2.53GHz, 8MB Cache, Hyper Threaded) with 16gig and 1tb harddrive with a 1gb port and my apache is causing my cpu to go up to 100% on all four cores heres my http.config <IfModule prefork.c> StartServers 10 MinSpareServers 10 MaxSpareServers 15... (4 Replies)
Discussion started by: awww
4 Replies

5. Programming

error: invalid conversion from ‘const char*’ to ‘char*’

Compiling xpp (The X Printing Panel) on SL6 (RHEL6 essentially): xpp.cxx: In constructor ‘printFiles::printFiles(int, char**, int&)’: xpp.cxx:200: error: invalid conversion from ‘const char*’ to ‘char*’ The same error with all c++ constructors - gcc 4.4.4. If anyone can throw any light on... (8 Replies)
Discussion started by: GSO
8 Replies

6. UNIX for Dummies Questions & Answers

Grep char count & pipe to sed command

Hi I am having a 'grep' headache Here is the contents of my file: (PBZ,CP,(((ME,PBZ,BtM),ON),((ME,((PBZ,DG),(CW9,PG11))),CW9,TS2,RT1))) I would like to count out how many times 'PBZ' occurs and then place that number in the line above 3... (8 Replies)
Discussion started by: cavanac2
8 Replies

7. Shell Programming and Scripting

grep : search a long char contain space

Hi, i have to search for a char like that : export var1="i am not happy /not happy" with a command like : grep $var1 file but this not working with me !!! thank you in advance. (2 Replies)
Discussion started by: tizilfin
2 Replies

8. UNIX for Dummies Questions & Answers

How to display first 7 char of grep results?

My file contains the following: uat2000.aspclient.active=true uat2001.aspclient.active=true uat2002.aspclient.active=true uat2003.aspclient.active=true uat2004.aspclient.active=false uat2005.aspclient.active=false uat2006.aspclient.active=false uat2007.aspclient.active=false... (8 Replies)
Discussion started by: kthatch
8 Replies

9. UNIX for Advanced & Expert Users

Sun: High kernel usage & very high load averages

Hi, I am seeing very high kernel usage and very high load averages on my system (Although we are not loading much data to our database). Here is the output of top...does anyone know what i should be looking at? Thanks, Lorraine last pid: 13144; load averages: 22.32, 19.81, 16.78 ... (4 Replies)
Discussion started by: lorrainenineill
4 Replies
Login or Register to Ask a Question