Skip to main content

All Questions

Tagged with
1 vote
2 answers
2k views

How may I replace a string in an XML file?

I am trying to replace the string inside an XML file. From <hello="value" exampleno="xxxx:yyyyyyyy/dd=eeeee-ffffff,aa=bb ccc,dd=eeee,ff=gggg,hh=iii,jj=kkk,ll=mmmm" /> I want ...
Ganesh's user avatar
  • 19
3 votes
2 answers
1k views

Find a pattern (of a child tag) and replace the entire parent tag at XML files, without using sed tool [duplicate]

Is there a way to find a pattern (of a child tag) and replace the entire parent tag, using regular expressions?  I'm working from a Linux server without a graphics environment. I have XML like: <?...
oswaldog's user avatar
0 votes
4 answers
2k views

how to remove New line character using Sed or perl [duplicate]

I have a huge file of XML data containing the lines like <fonts> some of the data </fonts> <fonts> some of the data </fonts> <fonts> some of the data </fonts> <...
vinay desai's user avatar
1 vote
1 answer
657 views

How to find max value from specific XML element using a Perl one liner?

I have an XML file with the following syntax <element> <id>0</id> <tag1>something</tag1> ... <tagn>something</tagn> </element> <element> ...
mrdatamx's user avatar
1 vote
1 answer
2k views

how to verify XML that include specific tags

is it possible to check by xmllint if xml include the follwing tags: Name uniq_String Version example of xml with three tags: <?xml version="1.0" encoding="UTF-8" ?> <!-- tasks ...
yael's user avatar
  • 13.4k
0 votes
2 answers
919 views

Extract part of the logs to other file

1) We have a process.log file in which we have lot of text data and in between we have some XML data published. 2) There of thousands of different XML published in the logs along with other text data. ...
abhishek chaudhry's user avatar
4 votes
1 answer
1k views

filter xml documents matching certains ids

Suppose you have a file containing many xml documents, like <a> <b> ... </a> in between xml documents there may be plain text log messages <x> ... </x> ... How ...
Evgeniy Berezovsky's user avatar
0 votes
1 answer
183 views

Perl code to refer to multiple file of the same extension (.xml)

I'm trying to parse multiple xml files but i'm a bit stuck with something. The $twig->parsefile("output_1.xml"); section of the below script works fine in parsing the file stated. However, I would ...
neilH's user avatar
  • 433
2 votes
4 answers
133 views

How to append a line that does not start with '<' to the previous line

I have a log which contains XML lines. Sample format below: <head> <body> <line> asdasd</line> </body> </head> I want to scan the log file and ...
Cyphered's user avatar
4 votes
2 answers
2k views

alter a line and remove tag using perl from xml file?

I have an xml file (client_23.xml) in which I need to alter one line and remove one whole tag from it so I came up with perl script: In my xml file, I have a block like this. There will be only one ...
user1950349's user avatar
1 vote
1 answer
398 views

How do I synchronize 2 xml files?

I have 2 xml files named 1k.xml and 1n.xml. The file 1k.xml contains some additional elements and data which are not there in 1n.xml. I want to copy whatever is absent in 1n.xml to it, so that both ...
One Face's user avatar
  • 348
4 votes
1 answer
5k views

Convert xml subtitle file to srt format

I have a xml subtitle that looks like this: <?xml version="1.0" encoding="utf-8" ?><transcript> <Item from="1.16" duration="4.68"><![CDATA[(Dong-hyuk is coming to see you now.) ...
aws's user avatar
  • 41
4 votes
3 answers
12k views

Delete XML node containing certain element

I want to remove all Placemarks from a KML file that contain the element <tessellate>. The following block should be wholly removed: <Placemark> <styleUrl>#m_ylw-pushpin330</...
admirabilis's user avatar
  • 4,742
4 votes
3 answers
2k views

Parsing XML from a shell script

I have a datafile like this: <Key name="com.ahsay.afc.cpf.UserGroup" content="" allowMultiple="Y"> <Value name="rsv-id" inheritParentAttribute="Y" type="string" data="1328200856753" /&...
Miq's user avatar
  • 41