Replace characters in a string using their ascii value

Hi All,

In the HP Unix that i'm using when i initialise a string as Stalled="'30�G'"
Stalled=$Stalled" '30�C'", it is taking the character � as a comma. I need to grep for 30�G 30�C in a file and take its count. But since this character � is not being understood, the count returns a zero.
The ascii value of the character � is 188.
I thought of replacing all occurrences of comma using something like
chr(188). But i dont know how to.
Could some one help me or give me some other idea to go about this. I need to do this urgently :frowning:
Thanks in advance...

tr '\188' ',' < file

Hi vgersh99

Thank u very much for the pointer u gave. But i cracked this problem using grep itself. I said in 30�G, let the 3rd character(each record in the file starts with 30�G or 30�C ) be anything other than zero (since in the file it is alwz � and never zero.) and the fourth character shud be [GC]. From the grep, i got the count..

Thanks anyways coz i learnt what "tr" command is all about. I'm new to unix and my work revolves around unix. So i'm learning Unix while i'm working on live problems. :slight_smile: