Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Search Forums:



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 10-17-2008
Registered User
 

Join Date: Aug 2008
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
XML Awk : Urgent

Hi All,

I am a beginner to Unix. So would really appreciate if people out here can help me out.

I have a XML file which has a element <NoteData> in which two values DBHA and DAKO.

I need to search these in all the XML files in a directory and if found in the XML file then replace the below location element value either with DBHA or DAKO as what is contained in the XML element <NoteData>.

I need to make sure that the value substituted happens only in the first Location element.

<?xml version="1.0" encoding="ISO-8859-1"?>
<XmlInterchange xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="XML Schema" Version="1"> <InterchangeInfo>
<Date>2008-10-17T07:17:40.5870000+02:00</Date>
<Source>
<EnterpriseCode>DFD</EnterpriseCode>
<CompanyCode>BRE</CompanyCode>
<OriginServer>DEV</OriginServer>
<LoginName>anker.hansen</LoginName>
<LoginUserEmailAddress>anker.hansen@dsv.com</LoginUserEmailAddress>
</Source>
<Target />
<EDIOrganisation EDICode="00010973" OwnerCode="00010973">
<OrganisationDetails>
<Name>DSV Air &amp; Sea GmbH LKW</Name>
<Location Country="Germany" City="Bremen">DEBRE</Location>
<Addresses>
<Address AddressType="MAIN">
<AddressLine1>Knowledge Center Seafreight</AddressLine1>
<AddressLine2>Schlachte 15-18</AddressLine2>
<AddressCode>Knowledge Center Seafreig</AddressCode>

Thanks & Regards
Karan
Sponsored Links
    #2  
Old 10-17-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 8,506
Thanks: 67
Thanked 401 Times in 390 Posts
Your example doesn't have <NoteData>....
Sponsored Links
    #3  
Old 10-17-2008
Registered User
 

Join Date: Aug 2008
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
That element can be anywhere in the data
    #4  
Old 10-18-2008
fpmurphy's Avatar
who?
 

Join Date: Dec 2003
Location: /dev/ph
Posts: 4,043
Thanks: 35
Thanked 282 Times in 263 Posts
This thread closed because OP opened another thread on same issue.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Hi Urgent yhacks Programming 5 05-28-2008 05:24 AM
Need Urgent Help!!! Furqan_79 Shell Programming and Scripting 3 05-24-2008 06:33 PM
URGENT,URGENT- Need help tape drive installation sriny UNIX for Advanced & Expert Users 3 11-16-2006 02:43 PM
URGENT---URGENT--No OK PROMPt after RSC CONFIG sriny Solaris 7 10-29-2006 10:06 AM
urgent help Yabanci Shell Programming and Scripting 1 03-08-2005 03:38 PM



All times are GMT -4. The time now is 05:16 AM.