LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 12-16-2012, 07:17 AM   #1
gautamshrm3
LQ Newbie
 
Registered: Dec 2012
Posts: 2

Rep: Reputation: Disabled
how to edit a xml file


Hi, i am new comer in linux script
i have a xml and i want to search a text and this text is find in which tag i want to copy this tag and paste in below it. and remove it child tag. how can i do?

before searching and editing ::
example
<root>
<emp name="abc">
<company addr="xyz"></company>
<company name="zxc"></company>
</emp>
<emp name="jkl">
<company addr="123"></company>
<company name="qwe"></company>
</emp>
</root>

i want to search a string company addr "xyz" and copy it tag <emp> and paste it below and remove all it child tag Like:-

<root>
<emp name="abc">
<company addr="xyz"></company>
<company name="zxc"></company>
</emp>
<emp name="abc">
</emp>
<emp name="jkl">
<company addr="123"></company>
<company name="qwe"></company>
</emp>
</root>


please help me how can i do this
 
Old 12-16-2012, 10:51 AM   #2
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
use conglomerate editor.
 
Old 12-16-2012, 10:47 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

http://www.linuxquestions.org/questi...4/#post4849985
 
  


Closed Thread



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to add xml-stylesheet tag in a XML File using libxml2 ? peacemission Programming 6 05-26-2012 02:20 AM
perl or batch file (xml edit) hehu Programming 3 01-15-2011 07:32 AM
Edit comps-rhel5-server-core.xml bobbera Linux - General 0 11-02-2010 06:23 AM
Edit an XML from bash script DeepRaj Linux - Newbie 6 03-05-2010 02:28 AM
xml formatting is being inserted when I edit some of my posts. jschiwal LQ Suggestions & Feedback 2 01-20-2008 12:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:29 AM.

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