Extract data fields from XML into Excel

喜你入骨 提交于 2019-12-05 10:52:43

If the XML has a flat structure like this:

you could just convert the "XML" column into an XML file and re-import it into your excel sheet. To do so, just

copy & paste the XML column into a text editor,

<customer><age>34</age><gender>m</gender></customer>
<customer><age>38</age><gender>f</gender></customer>

add a opening/closing root element,

<customers>
    <customer><age>34</age><gender>m</gender></customer>
    <customer><age>38</age><gender>f</gender></customer>
</customers>

and save as customers.xml.

Now. import it back into excel, using XML-> Import from the Developer Tools Ribbon. Based on the "flat" XML structure, Excel will create columns for the single values:

Of course this will work only if the XML structure is suitable, but if it does, it works without writing a macro or parsing the "XML" text content manually.

Open one of the xml form - go to file menu - share - export to excel - follow the instructions. In the export to excel you will find that, you can add all the xml forms if they are identical and export the data into one excel file in one go.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!