![]() |
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 |
| To parse through the file and print output using awk or sed script | cdfd123 | Shell Programming and Scripting | 4 | 03-03-2008 12:07 PM |
| Parse a string in XML file using shell script | ayhanne | Shell Programming and Scripting | 46 | 01-09-2008 12:33 PM |
| Creating menus in script file | sinjin | UNIX for Dummies Questions & Answers | 6 | 12-11-2007 12:00 AM |
| Creating a menu within a script file | sinjin | Shell Programming and Scripting | 8 | 12-10-2007 01:18 AM |
| How to parse config variables from external file to shell script | pradsh | Shell Programming and Scripting | 2 | 07-09-2007 02:21 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Need help in creating a Unix Script to parse xml file
Hi All,
My requirement is create an unix script to parse the xml file and display the values of the Elements/value between the tags on console. Like say, I would like to fetch the value of errorCode from the below xml which is 'U007' and display it. Can we use SED command for this? I have tried using the following command but is not working: Code:
sed -n -e "s/<errorCode>\([a-z]*[0-9]*\)<\/errorCode>/\1/p" /x01/hub/data/incoming/Txn200802251031080012-093624998419.xml Code:
<gDSNError> <errorCode>U007</errorCode> <errorDescription>00093624998419|BEST_BUY_LONG_DESCRIPTION|PDQ Import - The value coded against this attribute exceeds the maximum field length. Please amend & resend.</errorDescription> <errorDateTime>2008-02-26T09:04:11.728-00:00</errorDateTime> </gDSNError> Last edited by Yogesh Sawant; 04-10-2008 at 07:26 AM.. Reason: added code tags |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|