خرید بک لینک

I have 2 xml files. The 2nd file has some new entries including same entries as that of the 1st file. Examples of the 2 files are given below.

File 1

<SERVERNAME_ONE>
        <Protocol>FTP</Protocol>
        <ServerIP>192.168.0.231</ServerIP>
</SERVERNAME_ONE>

File 2

<SERVERNAME_ONE>
        <Protocol>FTP</Protocol>
        <ServerIP>192.168.1.21</ServerIP>
</SERVERNAME_ONE>
<SERVERNAME_TWO>
        <Protocol>FTP</Protocol>
        <ServerIP>192.168.13.231</ServerIP>
</SERVERNAME_TWO>

After merge

<SERVERNAME_ONE>
        <Protocol>FTP</Protocol>
        <ServerIP>192.168.0.231</ServerIP>
</SERVERNAME_ONE>
<SERVERNAME_TWO>
        <Protocol>FTP</Protocol>
        <ServerIP>192.168.13.231</ServerIP>
</SERVERNAME_TWO>

When i merge 2nd file with the 1st file,the merge should happen in such a way that only new entries in the 2nd file must be merged, i.e, already existing entries in 1st file must remain as they are. There is sdiff command to merge interactively. But i want to automate the merge process. How do i merge these files?

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 25 اسفند 1394 ساعت: 14:09

صفحه بندی