使用Value Tag将Excel转换为XML

时间:2017-05-18 16:53:38

标签: xml excel

我有一个看起来像这样的XML ..需要一些帮助将Excel转换为XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<Folders>

  <level1 Value="Communications">
     <level2>Correspondence</level2>   
     <level2>Project Meetings</level2>  
  </level1>

  <level1 Value="Project Controls">
     <level2>Close Out</level2>   
     <level2>Financials</level2>  
  </level1>

  <level1 Value="Reports">
     <level2>Close Out</level2>   
     <level2>Financials</level2>  
  </level1>

</Folders>

和Excel看起来像这样.. enter image description here

1 个答案:

答案 0 :(得分:0)

您可以从单元格C2开始尝试此公式并将其向下拖动,

=IF(A2<>"","<"&$A$1&" Value="&""""&MID(A2,5,999)&""""&">","      <"&$B$1&">"&MID(B2,5,999)&"</"&$B$1&">")

enter image description here

然后,您可以将其复制到txt文件并进行少量修改。