Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 11-30-2010, 04:49 AM   #1
LQ Newbie
Registered: Oct 2010
Location: India
Distribution: Mac OS
Posts: 12

Rep: Reputation: 0
how to find the end tag in xml file.


I am newbie. I wanted to know how to find the end tag in shell where I have multiple tags in xml like

<tag name="x" version="1.0">
<tag name="x" version="1.0">
<tag name="x" version="1.0">

And I wanted to update depends this xml as (in side the tag <subtag name="y"/>) depending upon the conditions like if 1,I have to update the first tag with the above mentioned tag and second and so on..

Maria Kumar

Last edited by mariakumar; 11-30-2010 at 04:57 AM.
Old 12-21-2010, 11:12 AM   #2
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 509

Rep: Reputation: 95

I would recommend you use Perl no shell.
Can you, if your XML lines above are the input, give clearly what you would like the output to be.
Then it should be easy to do it in Perl. Then fire the Perl from shell, as Perl is surely by default installed in all modern Linux boxes.




Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find the tag value in xml file through unix shell script hussain.s Linux - General 2 11-03-2010 08:52 AM
Need assistance with shell script - replace a string with a start tag and end tag SupermanInNY Programming 18 01-02-2010 06:44 PM
How To get the data from a tag in XML File kingmaker2003 Programming 7 12-05-2008 12:12 AM
find an TAG in a file and specify a parm mcandy_123 Programming 2 01-17-2008 01:00 PM
XML doesn't find XSL-file ronald-be Linux - Software 5 03-29-2006 01:24 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:14 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration