小编Sam*_*ert的帖子

How to copy an xml tag and its value into another xml file under the same root tag

I need to copy an xml tag and its value to another xml file under same root tag. Create the root tag if it doesn't exist.

Here is an input output example.

INPUT: string.xml
<resource>
    <string name="app_name">MyExampleApp</string>
    <string name="profile">My Profile</string>
    <string name="messages">My Messages</string>
</resource>

$ command "profile" string.xml string1.xml

OUTPUT: string1.xml
<resource>
    <string name="profile">My Profile</string>
</resource>
Run Code Online (Sandbox Code Playgroud)

I was looking for that "Command" and options. Not necessarily in that order. Please help me out here. Any Linux/Unix/Mac command will do

xml text-processing

1
推荐指数
1
解决办法
1530
查看次数

标签 统计

text-processing ×1

xml ×1