本帖最后由 zhengwei007 于 2024-3-20 11:07 编辑
这个文件a.xml中,有几千行以下内容的代码,我取其中之一,如下:- <?xml version="1.0" encoding="UTF-8"?>
- <list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/augmentation_retailchances.xsd">
- <weapon type="warrior">
- <stone id="8723">
- <variation id="1">
- <category probability="100">
- <augment id="1" chance="1.1" />
- <augment id="2" chance="1.1" />
- <augment id="3" chance="1.1" />
- <augment id="4" chance="1.1" />
- <augment id="5" chance="1.1" />
- <augment id="6" chance="1.1" />
- <augment id="7" chance="1.1" />
- <augment id="8" chance="1.1" />
- <augment id="9" chance="1.1" />
- <augment id="10" chance="1.1" />
- </category>
- </variation>
- <variation id="2">
- <category probability="55">
- <augment id="7281" chance="7.69" />
- <augment id="7282" chance="7.69" />
- <augment id="7283" chance="7.69" />
- <augment id="7284" chance="7.69" />
- <augment id="7285" chance="7.69" />
- <augment id="7286" chance="7.69" />
- <augment id="7287" chance="7.69" />
- <augment id="7288" chance="7.69" />
- <augment id="7289" chance="7.69" />
- <augment id="7290" chance="7.69" />
- <augment id="7291" chance="7.69" />
- <augment id="7292" chance="7.69" />
- <augment id="7293" chance="7.72" />
- </category>
- <category probability="35">
- <augment id="8191" chance="5.88" />
- <augment id="8192" chance="5.88" />
- <augment id="8193" chance="5.88" />
- <augment id="8194" chance="5.88" />
- <augment id="8195" chance="5.88" />
- <augment id="8196" chance="5.88" />
- <augment id="8197" chance="5.88" />
- <augment id="8198" chance="5.88" />
- <augment id="8199" chance="5.88" />
- <augment id="8200" chance="5.88" />
- <augment id="8201" chance="5.88" />
- <augment id="8202" chance="5.88" />
- <augment id="8203" chance="5.88" />
- <augment id="8204" chance="5.88" />
- <augment id="8205" chance="5.88" />
- <augment id="8206" chance="5.88" />
- <augment id="8207" chance="5.92" />
- </category>
- <category probability="7">
- <augment id="14578" chance="0.93" />
- <augment id="14579" chance="0.93" />
- <augment id="14580" chance="0.93" />
- <augment id="14581" chance="0.93" />
- <augment id="14582" chance="0.93" />
- <augment id="14583" chance="0.93" />
- <augment id="14584" chance="0.93" />
- <augment id="14585" chance="0.93" />
- <augment id="14586" chance="0.93" />
- <augment id="14587" chance="0.93" />
- <augment id="14588" chance="0.93" />
- </category>
- <category probability="3">
- <augment id="14685" chance="1.85" />
- <augment id="14686" chance="1.85" />
- <augment id="14687" chance="1.85" />
- <augment id="14688" chance="1.85" />
- <augment id="14689" chance="1.85" />
- <augment id="14690" chance="1.85" />
- <augment id="14691" chance="1.85" />
- <augment id="14692" chance="1.85" />
- <augment id="14693" chance="1.85" />
- <augment id="14694" chance="1.85" />
- <augment id="14695" chance="1.85" />
- </category>
- </variation>
- </stone>
复制代码 我希望通过批处理能整理成以下内容,标题我自己写,直接输出到sour.csv中即可- stone id variation id category probability augment id
- 8723 1 100 1
- 8723 1 100 2
- 8723 1 100 3
- 8723 1 100 4
- 8723 1 100 5
- 8723 1 100 6
- 8723 1 100 7
- 8723 1 100 8
- 8723 1 100 9
- 8723 1 100 10
- 8723 2 55 7281
- 8723 2 55 7282
- 8723 2 55 7283
- 8723 2 55 7284
- 8723 2 55 7285
- 8723 2 55 7286
- 8723 2 55 7287
- 8723 2 55 7288
- 8723 2 55 7289
- 8723 2 55 7290
- 8723 2 55 7291
- 8723 2 55 7292
- 8723 2 55 7293
- 8723 2 35 8191
- 8723 2 35 8192
- 8723 2 35 8193
- 8723 2 35 8194
- 8723 2 35 8195
- 8723 2 35 8196
- 8723 2 35 8197
- 8723 2 35 8198
- 8723 2 35 8199
- 8723 2 35 8200
- 8723 2 35 8201
- 8723 2 35 8202
- 8723 2 35 8203
- 8723 2 35 8204
- 8723 2 35 8205
- 8723 2 35 8206
- 8723 2 35 8207
- 8723 2 7 14578
- 8723 2 7 14579
- 8723 2 7 14580
- 8723 2 7 14581
- 8723 2 7 14582
- 8723 2 7 14583
- 8723 2 7 14584
- 8723 2 7 14585
- 8723 2 7 14586
- 8723 2 7 14587
- 8723 2 7 14588
- 8723 2 3 14685
- 8723 2 3 14686
- 8723 2 3 14687
- 8723 2 3 14688
- 8723 2 3 14689
- 8723 2 3 14690
- 8723 2 3 14691
- 8723 2 3 14692
- 8723 2 3 14693
- 8723 2 3 14694
- 8723 2 3 14695
复制代码
|