gpt4 book ai didi

xml - 合并两个 XML 文件

转载 作者:数据小太阳 更新时间:2023-10-29 02:54:23 25 4
gpt4 key购买 nike

<分区>

我有两个具有以下格式的 XML 文件文件1

<info>
<organization_id>123</organization_id>
<total_patients>5</total_patients>
</info>
<patients>
<patient>
<guid>1111</guid>
</patient>
<patient>
<guid>2222</guid>
</patient>
</patients>

文件 2

<info>
<organization_id>456</organization_id>
<total_patients>10</total_patients>
</info>
<patients>
<patient>
<guid>3333</guid>
</patient>
<patient>
<guid>4444</guid>
</patient>
</patients>

我想将两个文件合二为一,格式如下

输出文件

<info>
<total_patients>15</total_patients>
</info>
<organizations>
<organization>
<organization_id>123</organization_id>
<patients>
<patient>
<guid>1111</guid>
</patient>
<patient>
<guid>1111</guid>
</patient>
</patients>
</organization>
<organization>
<organization_id>456</organization_id>
<patients>
<patient>
<guid>4444</guid>
</patient>
<patient>
<guid>5555</guid>
</patient>
</patients>
</organization>
</organizations>

如果有任何建议,我将不胜感激。我一直在搜索谷歌,找不到任何类似的东西。谢谢

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com