Sponsored Content
Top Forums Shell Programming and Scripting Substitute partial data only within a xml tag Post 302590221 by roshanjain2 on Saturday 14th of January 2012 11:06:14 PM
Old 01-15-2012
Substitute partial data only within a xml tag

Hello,

I have huge xml files and I need to replace only part of the data within a particular xml tag. This doesnt seem to be as simple as it sounds. I have searched everywhere and couldnt find any solution.

Ex:
In the below case I would like "def" to be replaced by "xyz" only when found in tag2 and not anywhere else.

sample line in xml file:
<tag1>def ghi</tag1><tag2>abc def ghi</tag2><tag3>def jkl</tag3>

desired output:
<tag1>def ghi</tag1><tag2>abc xyz ghi</tag2><tag3>def jkl</tag3>
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How To get the data from a tag in XML File

Hi I have a XML file in which data is loaded from a relational table and the column names are tags in the xml file which is shown below. ... (8 Replies)
Discussion started by: naughty21
8 Replies

2. Shell Programming and Scripting

How to retrieve the value from XML tag whose end tag is in next line

Hi All, Find the following code: <Universal>D38x82j1JJ </Universal> I want to retrieve the value of <Universal> tag as below: Please help me. (3 Replies)
Discussion started by: mjavalkar
3 Replies

3. Shell Programming and Scripting

How to add the multiple lines of xml tags before a particular xml tag in a file

Hi All, I'm stuck with adding multiple lines(irrespective of line number) to a file before a particular xml tag. Please help me. <A>testing_Location</A> <value>LA</value> <zone>US</zone> <B>Region</B> <value>Russia</value> <zone>Washington</zone> <C>Country</C>... (0 Replies)
Discussion started by: mjavalkar
0 Replies

4. UNIX for Advanced & Expert Users

Shell Script to read XML tags and the data within that tag

Hi unix Gurus, I am really new to Unix Scripting. Please help me to create a shell script which reads the xml file and from that i need to fetch a particular information. For example <SOURCE BUSINESSNAME ="" DATABASETYPE ="Teradata" DBDNAME ="DWPROD3" DESCRIPTION ="" NAME... (2 Replies)
Discussion started by: SmilePlease
2 Replies

5. Shell Programming and Scripting

XML Parse between to tag with upper tag

Hi Guys Here is my Input : <?xml version="1.0" encoding="UTF-8"?> <xn:MeContext id="01736"> <xn:VsDataContainer id="01736"> <xn:attributes> <xn:vsDataType>vsDataMeContext</xn:vsDataType> ... (12 Replies)
Discussion started by: pareshkp
12 Replies

6. UNIX for Dummies Questions & Answers

Partial match in two files then substitute

Hi, I was trying to figure this out but failed so I hope someone here can help me, thank you in advance. I have two files. file1: aa M bb N cc O dd P ee Q file2: aa A_87_P254063 cc A_87_P016532 bb A_87_P104793 dd A_87_P055331 ee A_87_P059706 aa A_87_P071636 ee A_87_P028302... (2 Replies)
Discussion started by: yuejian
2 Replies

7. Shell Programming and Scripting

To search for a particular tag in xml and collate all similar tag values and display them count

I want to basically do the below thing. Suppose there is a tag called object1. I want to display an output for all similar tag values under heading of Object 1 and the count of the xmls. Please help File: <xml><object1>house</object1><object2>child</object2>... (9 Replies)
Discussion started by: srkmish
9 Replies

8. UNIX for Dummies Questions & Answers

How to substitute for the partial match?

Hi I have a question and hope I can get answer here. Thank you in advance. I have two files: file1: aa X bb Y cc Z file2: cc A bb B dd C aa D bb E If the 1st column match in both file1 and file2, the 2nd column in file2 will be replaced by the 2nd column in file1. If there is no... (2 Replies)
Discussion started by: yuejian
2 Replies

9. Shell Programming and Scripting

Moving XML tag/contents after specific XML tag within same file

Hi Forum. I have an XML file with the following requirement to move the <AdditionalAccountHolders> tag and its content right after the <accountHolderName> tag within the same file but I'm not sure how to accomplish this through a Unix script. Any feedback will be greatly appreciated. ... (19 Replies)
Discussion started by: pchang
19 Replies
FIREWALLD.ICMPTYPE(5)						firewalld.icmptype					     FIREWALLD.ICMPTYPE(5)

NAME
firewalld.icmptype - firewalld icmptype configuration files SYNOPSIS
/etc/firewalld/icmptypes/icmptype.xml /usr/lib/firewalld/icmptypes/icmptype.xml DESCRIPTION
A firewalld icmptype configuration file provides the information for an Internet Control Message Protocol (ICMP) type for firewalld. This example configuration file shows the structure of an icmptype configuration file: <?xml version="1.0" encoding="utf-8"?> <icmptype> <short>My Icmptype</short> <description>description</description> <destination ipv4="yes" ipv6="yes"/> </icmptype> OPTIONS
The config can contain these tags and attributes. Some of them are mandatory, others optional. icmptype The mandatory icmptype start and end tag defines the icmptype. This tag can only be used once in an icmptype configuration file. This tag has optional attributes: version="string" To give the icmptype a version. short Is an optional start and end tag and is used to give an icmptype a more readable name. description Is an optional start and end tag to have a description for a icmptype. destination Is an optional empty-element tag and can be used only once. The destination tag specifies if an icmptype entry is available for IPv4 and/or IPv6. The default is IPv4 and IPv6, where this tag can be missing. ipv4="bool" Describes if the icmptype is available for IPv4. ipv6="bool" Describes if the icmptype is available for IPv6. SEE ALSO
firewall-applet(1), firewalld(1), firewall-cmd(1), firewall-config(1), firewalld.conf(5), firewalld.direct(5), firewalld.icmptype(5), firewalld.lockdown-whitelist(5), firewall-offline-cmd(1), firewalld.richlanguage(5), firewalld.service(5), firewalld.zone(5), firewalld.zones(5) NOTES
firewalld home page at fedorahosted.org: http://fedorahosted.org/firewalld/ More documentation with examples: http://fedoraproject.org/wiki/FirewallD AUTHORS
Thomas Woerner <twoerner@redhat.com> Developer Jiri Popelka <jpopelka@redhat.com> Developer firewalld 0.3.9 FIREWALLD.ICMPTYPE(5)
All times are GMT -4. The time now is 04:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy