![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| reading and searching xml element text in script | forevercalz | Shell Programming and Scripting | 2 | 11-24-2005 06:36 PM |
| reading and searching xml element text in script | forevercalz | Shell Programming and Scripting | 6 | 11-10-2005 08:35 PM |
| searching searching | tony3101 | Shell Programming and Scripting | 3 | 06-04-2004 08:50 AM |
| searching for { | yotoruja | Shell Programming and Scripting | 4 | 11-03-2003 07:07 AM |
| Shell Script for searching files with date as filter | kanakaraj_s | Shell Programming and Scripting | 3 | 05-14-2002 08:15 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hey,
I need to parse the following XML to just grab the Customer ID. Is there any RegEx that can achieve this ? So in this example, the script just return 0000109654, as the output. Even if it involves awk, sed please let me know. ************ <?xml version="1.0" encoding="UTF-8"?> <ns0:CustomerUpdate xmlns:ns0="http://www.hmco.com/schemas/sfa/customer_update" FileName="" CustomerUpdateDateTime="2006-05-24T23:02:47.366-04:00" Count="1"><ns0:Customer CustomerID="0000109654" CustomerName="BETHEL PUBLIC SCHOOLS" Status=" A" ClassCode="G" ClassName="Governing Organiz." <ns0:Address AddressLine1="220 175TH ST S " AddressLine2="LEARNING ASESSMENT BULDING" AddressLine3="" City="SPANAWAY" State="WA" ZipCode="98387-8703" CountyName="PIERCE" CountryCode="US" CountryName="US A"/></ns0:Customer></ns0:CustomerUpdate> ************ Thanks in advance, Arun. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
sed '/CustomerID/!d;s/.*CustomerID="\([0-9]*\)" Customer.*/\1/g;' filename
|
|||
| Google The UNIX and Linux Forums |