LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   grep for British pound sign? (https://www.linuxquestions.org/questions/linux-software-2/grep-for-british-pound-sign-266054/)

ilikejam 12-13-2004 05:50 PM

grep for British pound sign?
 
Hi all

I'm trying to parse a web page for prices in £.

The problem is that grep doesn't recognise the £ sign, and so doesn't return lines which contain it. Anyone know how this is done?

Cheers.

Dave

mikeghet 12-13-2004 06:03 PM

are you able to use ASCII codes???

http://www.asciitable.com/

decimal value 156 = british pound sign.

ilikejam 12-13-2004 06:37 PM

I've sort of solved the problem.

If I convert the web page to UTF-8 (with iconv -f ISO-8859-1 -t UTF-8 go.htm) grep works fine. I think I could probably get a similar effect by changing the $LANG variable, but iconv works for me.

It would be nice if grep could take ASCII codes, but I don't think it does. (There's no mention in the man page).

Cheers anyway.

Dave


All times are GMT -5. The time now is 06:08 PM.