![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Weird Ascii characters in file names | yamsin789 | Shell Programming and Scripting | 2 | 10-07-2007 10:27 AM |
| Multibyte characters to ASCII | jerardfjay | Shell Programming and Scripting | 8 | 11-18-2005 02:45 AM |
| Hex characters of ascii file | budrito | HP-UX | 2 | 08-10-2005 10:26 PM |
| stupid question about ascii characters | jalburger | High Level Programming | 2 | 09-28-2004 03:56 PM |
| Replace string and delete extra characters | slaubhan | Shell Programming and Scripting | 2 | 08-28-2003 05:49 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 :-( Thanks in advance... |
|
||||
|
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. :-) |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|