如何从 2 个文件 Xml 中替换 Notepad ++ 中标签内的文本?

如何从 2 个文件 Xml 中替换 Notepad ++ 中标签内的文本?

例子:

文件 1:

<CannonExp.xml>
<String>
    <ID>    1   </ID>
    <ASCII> Memiliki beberapa Giant crossbow yang dapat menyerang jarak jauh. Kelemahan fortress ini adalah defensenya yang masih lemah.    </ASCII>
    <Unicode>   TQBlAG0AaQBsAGkAawBpACAAYgBlAGIAZQByAGEAcABhACAARwBpAGEAbgB0ACAAYwByAG8AcwBzAGIAbwB3ACAAeQBhAG4AZwAgAGQAYQBwAGEAdAAgAG0AZQBuAHkAZQByAGEAbgBnACAAagBhAHIAYQBrACAAagBhAHUAaAAuACAASwBlAGwAZQBtAGEAaABhAG4AIABmAG8AcgB0AHIAZQBzAHMAIABpAG4AaQAgAGEAZABhAGwAYQBoACAAZABlAGYAZQBuAHMAZQBuAHkAYQAgAHkAYQBuAGcAIABtAGEAcwBpAGgAIABsAGUAbQBhAGgALgA=    </Unicode>
</String>
<String>
    <ID>    2   </ID>
    <ASCII> Dapat melemparkan batu besar yang menyebabkan serangan area. Kelemahan fortress ini adalah jarak serangannya yang terlalu pendek.   </ASCII>
    <Unicode>   RABhAHAAYQB0ACAAbQBlAGwAZQBtAHAAYQByAGsAYQBuACAAYgBhAHQAdQAgAGIAZQBzAGEAcgAgAHkAYQBuAGcAIABtAGUAbgB5AGUAYgBhAGIAawBhAG4AIABzAGUAcgBhAG4AZwBhAG4AIABhAHIAZQBhAC4AIABLAGUAbABlAG0AYQBoAGEAbgAgAGYAbwByAHQAcgBlAHMAcwAgAGkAbgBpACAAYQBkAGEAbABhAGgAIABqAGEAcgBhAGsAIABzAGUAcgBhAG4AZwBhAG4AbgB5AGEAIAB5AGEAbgBnACAAdABlAHIAbABhAGwAdQAgAHAAZQBuAGQAZQBrAC4A    </Unicode>
</String>
<String>
    <ID>    3   </ID>
    <ASCII> Dapat menembakkan banyak misil pada saat yang bersamaan. Kekuatan serangan besar dan kecepatan serangan yang tinggi. Memiliki kemampuan rata-rata.  </ASCII>
    <Unicode>   RABhAHAAYQB0ACAAbQBlAG4AZQBtAGIAYQBrAGsAYQBuACAAYgBhAG4AeQBhAGsAIABtAGkAcwBpAGwAIABwAGEAZABhACAAcwBhAGEAdAAgAHkAYQBuAGcAIABiAGUAcgBzAGEAbQBhAGEAbgAuACAASwBlAGsAdQBhAHQAYQBuACAAcwBlAHIAYQBuAGcAYQBuACAAYgBlAHMAYQByACAAZABhAG4AIABrAGUAYwBlAHAAYQB0AGEAbgAgAHMAZQByAGEAbgBnAGEAbgAgAHkAYQBuAGcAIAB0AGkAbgBnAGcAaQAuACAATQBlAG0AaQBsAGkAawBpACAAawBlAG0AYQBtAHAAdQBhAG4AIAByAGEAdABhAC0AcgBhAHQAYQAuAA==    </Unicode>
</String>   

文件 2:

<CannonExp.xml>
<String>
    <ID>    1   </ID>
    <ASCII> Phao ?ai phong th? dung c? n? b?n ten nhi?u l?n t?n cong c? ly xa, s?c phong ng? h?i y?u la khuy?t ?i?m c?a no  </ASCII>
    <Unicode>   UABoAOEAbwAgABEB4ABpACAAcABoAPIAbgBnACAAdABoAOceIABkAPkAbgBnACAAYwDxHiAAbgDPHiAAYgCvHm4AIAB0AOoAbgAgAG4AaABpAMEedQAgAGwApx5uACAAdAClHm4AIABjAPQAbgBnACAAYwDxHiAAbAB5ACAAeABhACwAIABzAOkeYwAgAHAAaADyAG4AZwAgAG4AZwDxHiAAaAChAWkAIAB5AL8edQAgAGwA4AAgAGsAaAB1AHkAvx50ACAAEQFpAMMebQAgAGMA5x5hACAAbgDzAA==    </Unicode>
</String>
<String>
    <ID>    2   </ID>
    <ASCII> Phao ?ai phong th? kien c? va co kh? n?ng nem nh?ng t?ng ?a l?n t?o sat th??ng ph?m vi, t?m b?n h?i ng?n la nh??c ?i?m c?a no   </ASCII>
    <Unicode>   UABoAOEAbwAgABEB4ABpACAAcABoAPIAbgBnACAAdABoAOceIABrAGkA6gBuACAAYwDRHiAAdgDgACAAYwDzACAAawBoAKMeIABuAAMBbgBnACAAbgDpAG0AIABuAGgA7x5uAGcAIAB0AKMebgBnACAAEQHhACAAbADbHm4AIAB0AKEebwAgAHMA4QB0ACAAdABoALABoQFuAGcAIABwAGgAoR5tACAAdgBpACwAIAB0AKcebQAgAGIArx5uACAAaAChAWkAIABuAGcArx5uACAAbADgACAAbgBoALAB4x5jACAAEQFpAMMebQAgAGMA5x5hACAAbgDzAA==    </Unicode>
</String>

替换后的文件:

<CannonExp.xml>
<String>
    <ID>    1   </ID>
    <ASCII> Phao ?ai phong th? dung c? n? b?n ten nhi?u l?n t?n cong c? ly xa, s?c phong ng? h?i y?u la khuy?t ?i?m c?a no  </ASCII>
    <Unicode>   UABoAOEAbwAgABEB4ABpACAAcABoAPIAbgBnACAAdABoAOceIABkAPkAbgBnACAAYwDxHiAAbgDPHiAAYgCvHm4AIAB0AOoAbgAgAG4AaABpAMEedQAgAGwApx5uACAAdAClHm4AIABjAPQAbgBnACAAYwDxHiAAbAB5ACAAeABhACwAIABzAOkeYwAgAHAAaADyAG4AZwAgAG4AZwDxHiAAaAChAWkAIAB5AL8edQAgAGwA4AAgAGsAaAB1AHkAvx50ACAAEQFpAMMebQAgAGMA5x5hACAAbgDzAA==    </Unicode>
</String>
<String>
    <ID>    2   </ID>
    <ASCII> Phao ?ai phong th? kien c? va co kh? n?ng nem nh?ng t?ng ?a l?n t?o sat th??ng ph?m vi, t?m b?n h?i ng?n la nh??c ?i?m c?a no   </ASCII>
    <Unicode>   UABoAOEAbwAgABEB4ABpACAAcABoAPIAbgBnACAAdABoAOceIABrAGkA6gBuACAAYwDRHiAAdgDgACAAYwDzACAAawBoAKMeIABuAAMBbgBnACAAbgDpAG0AIABuAGgA7x5uAGcAIAB0AKMebgBnACAAEQHhACAAbADbHm4AIAB0AKEebwAgAHMA4QB0ACAAdABoALABoQFuAGcAIABwAGgAoR5tACAAdgBpACwAIAB0AKcebQAgAGIArx5uACAAaAChAWkAIABuAGcArx5uACAAbADgACAAbgBoALAB4x5jACAAEQFpAMMebQAgAGMA5x5hACAAbgDzAA==    </Unicode>
</String>
<String>
    <ID>    3   </ID>
    <ASCII> Dapat menembakkan banyak misil pada saat yang bersamaan. Kekuatan serangan besar dan kecepatan serangan yang tinggi. Memiliki kemampuan rata-rata.  </ASCII>
    <Unicode>   RABhAHAAYQB0ACAAbQBlAG4AZQBtAGIAYQBrAGsAYQBuACAAYgBhAG4AeQBhAGsAIABtAGkAcwBpAGwAIABwAGEAZABhACAAcwBhAGEAdAAgAHkAYQBuAGcAIABiAGUAcgBzAGEAbQBhAGEAbgAuACAASwBlAGsAdQBhAHQAYQBuACAAcwBlAHIAYQBuAGcAYQBuACAAYgBlAHMAYQByACAAZABhAG4AIABrAGUAYwBlAHAAYQB0AGEAbgAgAHMAZQByAGEAbgBnAGEAbgAgAHkAYQBuAGcAIAB0AGkAbgBnAGcAaQAuACAATQBlAG0AaQBsAGkAawBpACAAawBlAG0AYQBtAHAAdQBhAG4AIAByAGEAdABhAC0AcgBhAHQAYQAuAA==    </Unicode>
</String>

请告诉我...

答案1

这是我有时使用的一种相当古怪的方法。假设您想将文件 A 中的文本放入文件 B,并将其夹在文件 B 中的其他某些文本中。

步骤 1:将每个文件的所有内容复制到 Word 中。仔细进行一些文本替换,为将文本转换为表格做好准备。将此表格复制到 Excel。根据需要重新格式化,根据需要删除列、行或单元格。

第 2 步:在 Word 中设置邮件合并(目录类型),从两个文件中提取数据,并使用所需的 XML 代码作为窗口装饰。

步骤 3:复制输出并粘贴到新的 Notepad++ 文件中。

相关内容