Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


Closed Thread
  Search this Thread
Old 12-16-2012, 07:17 AM   #1
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 ::
<emp name="abc">
<company addr="xyz"></company>
<company name="zxc"></company>
<emp name="jkl">
<company addr="123"></company>
<company name="qwe"></company>

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:-

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

please help me how can i do this
Old 12-16-2012, 10:51 AM   #2
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
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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.

Closed Thread

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 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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration