Sponsored Content
Top Forums Shell Programming and Scripting Shell or perl script to replace XML text in bulk Post 302737141 by Ashu_099 on Wednesday 28th of November 2012 11:48:58 AM
Old 11-28-2012
Well, it works Elixir thanks :-)
But i am wondering if there is way to give list of Text id from external file instead of just 98 and 12 as mentioned in code..

Code:
^<Text Id="(98|12)">/


Last edited by Scott; 11-28-2012 at 01:05 PM.. Reason: Ditto
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to replace a text inside a file based on a xml key

<c-param> <param-name>Number</param-name> <param-value>22</param-value> <description>my house number</description> </c-param> <c-param> <param-name>Address</param-name> ... (4 Replies)
Discussion started by: reldb
4 Replies

2. Shell Programming and Scripting

Shell Script to replace text

I need a little help with a shell script. I want to be able to specify parameters so that the script searches multiple files (specified as parameters) and only modifies the file if it finds the string of text. For the files it doesn't find the string of text within, it should leave it alone. ... (4 Replies)
Discussion started by: joebaber
4 Replies

3. Shell Programming and Scripting

Shell script (not Perl) to parse xml with awk

Hi, I have to make an script according to these: - I have couples of files like: xxxxxxxxxxxxx.csv xxxxxxxxxxxxx_desc.xml - every xml file has diferent fields, but keeps this format: ........ <defaultName>2011-02-25T16:43:43.582Z</defaultName> ........... (2 Replies)
Discussion started by: Pluff
2 Replies

4. Shell Programming and Scripting

Loop through text file > Copy Folder > Edit XML files in bulk?

I have a text file which contains lines in this format - it contains 105 lines in total, but I'm just putting 4 here to keep it short: 58571,east_ppl_ppla_por 58788,east_pcy_hd_por 58704,east_pcy_ga_por 58697,east_pcy_pcybs_por It's called id_key.txt I have a sample folder called... (9 Replies)
Discussion started by: biscuitcreek
9 Replies

5. Shell Programming and Scripting

Replace text inside XML file based on condition

Hi All, I want to change the name as SEQ_13 ie., <Property Name="Name">SEQ_13</Property> when the Stage Type is PxSequentialFile ie., <Property Name="StageType">PxSequentialFile</Property> :wall: Input.XML <Main> <Record Identifier="V0S13" Type="CustomStage" Readonly="0">... (3 Replies)
Discussion started by: kmsekhar
3 Replies

6. Shell Programming and Scripting

perl script to replace the text in the original file

Hi Folks, I have an html file which contains the below line in the body tagI am trying the replace hello with Hello Giridhar programatically. <body> <P><STRONG><FONT face="comic sans ms,cursive,sans-serif"><EM>Hello</EM></FONT></STRONG></P> </body> I have written the below code to... (3 Replies)
Discussion started by: giridhar276
3 Replies

7. UNIX for Dummies Questions & Answers

Reading XML file and print the values in the text file using Linux shell script

hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file <sequence> <Filename>aldorzum.doc</Filename> <DivisionCode>US</DivisionCode> <ContentType>Template</ContentType> <ProductCode>VIMZIM</ProductCode> </sequence>... (1 Reply)
Discussion started by: sravanreddy
1 Replies

8. Red Hat

How to replace Ip address in .xml file through shell script?

I have one .xml file. which contains the following line. <ParamString StringId="PortAddress" StringValue="172.27.166.170" /> <ParamString StringId="PortAddress" StringValue="172.27.166.171" /> <ParamString StringId="PortAddress" StringValue="172.27.166.202" /> <ParamString... (9 Replies)
Discussion started by: Anjan Ganguly
9 Replies

9. UNIX for Beginners Questions & Answers

Find replace text in xml file on the fly

Dear Unix guru, I have a .XML file which is being used to load data to oracle. This file comes on unix box and one of the tag in xml is oracle key word. I want to find that tag and replace with new tag on the fly For example I will get one of the tag in xml is as below <from>Test Test... (12 Replies)
Discussion started by: guddu_12
12 Replies
XML::LibXML::NodeList::Iterator(3pm)			User Contributed Perl Documentation		      XML::LibXML::NodeList::Iterator(3pm)

NAME
XML::LibXML::NodeList::Iterator - Iteration Class for XML::LibXML XPath results SYNOPSIS
use XML::LibXML; use XML::LibXML::NodeList::Iterator; my $doc = XML::LibXML->new->parse_string( $somedata ); my $nodelist = $doc->findnodes( $somexpathquery ); my $iter= XML::LibXML::NodeList::Iterator->new( $nodelist ); # more control on the flow while ( $iter->nextNode ) { # do something } # operate on the entire tree $iter->iterate( &operate ); DESCRIPTION
XML::LibXML::NodeList::Iterator is very similar to XML::LibXML::Iterator, but it does not iterate on the tree structure but on a XML::LibXML::NodeList object. Because XML::LibXML::NodeList is basicly an array the functionality of XML::LibXML::NodeList::Iterator is more restircted to stepwise foreward and backward than XML::LibXML::Iterator is. SEE ALSO
XML::LibXML::NodeList, XML::NodeFilter, XML::LibXML::Iterator AUTHOR
Christian Glahn, <phish@cpan.org> COPYRIGHT
(c) 2002-2007, Christian Glahn. All rights reserved. This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.0 2007-09-28 XML::LibXML::NodeList::Iterator(3pm)
All times are GMT -4. The time now is 09:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy