![]() |
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 |
| Need help to escape special characters in Korn shell script | rogers42 | UNIX for Dummies Questions & Answers | 6 | 05-14-2009 07:23 AM |
| Sed-Special character replacement | usshell | Shell Programming and Scripting | 3 | 05-22-2008 10:06 AM |
| bash script to check the first character in string | ole111 | Shell Programming and Scripting | 2 | 03-19-2008 12:34 AM |
| Check for special characters in a script | sumesh.abraham | Shell Programming and Scripting | 7 | 12-18-2006 09:15 AM |
| special character ? | mile1982 | High Level Programming | 1 | 10-19-2004 08:15 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Special Character Check in Shell script
Hi,
I'm currently working on a project that requires parsing xml file. One of the field in the xml is shown below (don't remember exactly): <variable="ITEM">12345678</variable> I coded my script keeping in mind that the value denoted in bold will always be a number. After getting just the number I have to fire a PL/SQL procedure from the script itself and get the data, and update the existing xml file with some new fields that i received by firing the procedure. But now the requirements have changed and now the users wants a check for special characters on the item shown as bold. eg: We refer the text in bold as Item Number. So if the following Item Number is found 1234%1234, in this case my script should remove only the % sign and put together the rest of the numbers and form one number. Now the problem is that there are 36 such special characters on the keyboard. I tried using ITEMNUMBER=echo $ITEMNUMBER|sed 's/%//g' But this would work for only one scenario. If i follow this case, I have to write 36 such statements and that would inturn reduce the performance of the script. PS: Keep in mind the following special charaters in unix 1. & - & 2. < - < 3. > - > 4. " - " 5. ' - ' Hoping for some help Thanks in advance. MK |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|