我有多个xml文件,需要一一比较根据关键相同字段来替换其他字段,用excel2013 来实现,怎么做?

yangftom 2017-07-10 01:24:00
需求:

1、有一个整体的XML文件和多个小的XML文件;
2、整体的XML文件为主,小的XML文件为辅;
3、通过一一打开小的XML文件来通过关键字search,找到整体XML文件对应的关键字,然后替换其他的字段值
举例:
小的XML文件中间某一段
-<Card>


-<Account1>

<ICCID>89860040191702161780</ICCID>

<IMSI>460002908135092</IMSI>

<KI>8ED46549BBD0583DD271D1D09F62201C</KI>

<OPC>BC1D09C3347FCE42DAC6479455C197FF</OPC>

<PIN>1234</PIN>

<PUK>09158921</PUK>

<PIN2>6481</PIN2>

<PUK2>58491628</PUK2>

<MSISDN>13570746236</MSISDN>

<User_Password>670277</User_Password>

</Account1>

</Card>

整体的XML文件,中间某一段:
-<Card>


-<Account1>

<ICCID>89860040191702161780</ICCID>

<IMSI>460002908135093</IMSI>

<KI>207EF2EF1A5CCC64B56AB34CAA9CE840</KI>

<OPC>0AC57B4AD190089DA8AF29AB4CB3EB5A</OPC>

<PIN>1234</PIN>

<PUK>54556972</PUK>

<PIN2>0027</PIN2>

<PUK2>51275855</PUK2>

<MSISDN>13702493275</MSISDN>

<User_Password>558282</User_Password>

</Account1>

</Card>

其中关键字段是一样的,即<ICCID>89860040191702161780</ICCID>是一样的,基于这个,要替换其他的字段内容值.

完整的XML截取如下:
<?xml version="1.0"?>

-<Output_File>


-<Batch_Info>

<Order_Number>PKG201702140002</Order_Number>

<Sub_Order_Number>201702130066</Sub_Order_Number>

<File_Time>201702221115</File_Time>

<Customer>CMCC</Customer>

<Province>GuangDong</Province>

<Province_Code>19</Province_Code>

<City>GZ</City>

<Area_Code>0200</Area_Code>

<SMSC_Number>+8613800200500</SMSC_Number>

<Vender>Gemalto</Vender>

<Vender_Code>0</Vender_Code>

<MSISDN_Sector>1380290</MSISDN_Sector>

<MSISDN_Group>1380273</MSISDN_Group>

<Batch_Quantity>101</Batch_Quantity>

</Batch_Info>


-<Data_Format>

<Card_Type>USIM</Card_Type>

<Data_Type>PKG</Data_Type>

<AccountNumbers>1</AccountNumbers>

<ICCID_Format Str_Length="20" Coding_Scheme="Hexadecimal" Field_Presented="True"/>

<BlankCardSN_Format Str_Length="20" Coding_Scheme="Hexadecimal" Field_Presented="False"/>

<IMSI_Format Str_Length="15" Coding_Scheme="Decimal" Field_Presented="True"/>

<KI_Format Str_Length="32" Coding_Scheme="Hexadecimal" Field_Presented="True" Kind="001" Encryption_Algorithm="K4" Encrypted="True"/>

<OPC_Format Str_Length="32" Coding_Scheme="Hexadecimal" Field_Presented="True" Kind="001" Encryption_Algorithm="K4" Encrypted="True"/>

<PIN_Format Str_Length="4" Coding_Scheme="Decimal" Field_Presented="True"/>

<PUK_Format Str_Length="8" Coding_Scheme="Decimal" Field_Presented="True"/>

<PIN2_Format Str_Length="4" Coding_Scheme="Decimal" Field_Presented="True"/>

<PUK2_Format Str_Length="8" Coding_Scheme="Decimal" Field_Presented="True"/>

<MSISDN_Format Str_Length="11" Coding_Scheme="Decimal" Field_Presented="True"/>

<User_Password_Format Str_Length="6" Coding_Scheme="Decimal" Field_Presented="True"/>

</Data_Format>


-<Data>


-<Card>


-<Account1>

<ICCID>89860040191702161780</ICCID>

<IMSI>460002908135092</IMSI>

<KI>8ED46549BBD0583DD271D1D09F62201C</KI>

<OPC>BC1D09C3347FCE42DAC6479455C197FF</OPC>

<PIN>1234</PIN>

<PUK>09158921</PUK>

<PIN2>6481</PIN2>

<PUK2>58491628</PUK2>

<MSISDN>13570746236</MSISDN>

<User_Password>670277</User_Password>

</Account1>

</Card>


-<Card>


-<Account1>

<ICCID>89860040191702161781</ICCID>

<IMSI>460002908135093</IMSI>

<KI>207EF2EF1A5CCC64B56AB34CAA9CE840</KI>

<OPC>0AC57B4AD190089DA8AF29AB4CB3EB5A</OPC>

<PIN>1234</PIN>

<PUK>54556972</PUK>

<PIN2>0027</PIN2>

<PUK2>51275855</PUK2>

<MSISDN>13702493275</MSISDN>

<User_Password>558282</User_Password>

</Account1>

</Card>


-<Card>


-<Account1>

<ICCID>89860040191702161782</ICCID>

<IMSI>460002908135094</IMSI>

<KI>AB36E7CB26B2B48BBEE5BA16B5F8B57E</KI>

<OPC>B924EC76413BDACA293F26DE4DF7E451</OPC>

<PIN>1234</PIN>

<PUK>35685634</PUK>

<PIN2>7684</PIN2>

<PUK2>06053991</PUK2>

<MSISDN>13702494037</MSISDN>

<User_Password>184348</User_Password>

</Account1>

</Card>


-<Card>


-<Account1>

<ICCID>89860040191702161783</ICCID>

<IMSI>460002908135095</IMSI>

<KI>182777FE09D52370C5E1CE0B6F64CCE1</KI>

<OPC>92229650FC969CD914E36A1B1C517119</OPC>

<PIN>1234</PIN>

<PUK>51139875</PUK>

<PIN2>7825</PIN2>

<PUK2>69314980</PUK2>

<MSISDN>13702494042</MSISDN>

<User_Password>348020</User_Password>

</Account1>

</Card>


-<Card>


-<Account1>

<ICCID>89860040191702161784</ICCID>

<IMSI>460002908135096</IMSI>

<KI>E6FD542AF8274AB9F93D2FB90DB5BC2B</KI>

<OPC>9AC395AD70ADF0E6D6A3F9EC7B6ED61A</OPC>

<PIN>1234</PIN>

<PUK>33930625</PUK>

<PIN2>7398</PIN2>

<PUK2>80971193</PUK2>

<MSISDN>13702494049</MSISDN>

<User_Password>890465</User_Password>

</Account1>

</Card>
</Output_File>
...全文
555 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

6,210

社区成员

发帖
与我相关
我的任务
社区描述
Microsoft Office应用
社区管理员
  • Microsoft Office应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧