将数据从xml文件提取到Excel或txt文件

时间:2019-01-16 13:32:59

标签: excel extract

我想弄清楚如何从xml中的记录中提取数据,然后将该信息放入excel或带有适当分隔符的文本文件中,以便我可以轻松地复制它。下面是一个记录示例,我只想从ITEM_NO,DESCRIPTION,CATEGORY,CLASSIFICATION,LIST_RATE中获取信息。

 <Record>
<ITEM_NO> 049000045734</ITEM_NO>
<ITEM_MANU>0</ITEM_MANU>
<LOCATION>2</LOCATION>
<DESCRIPTION>Powerade Lemon 32 Oz</DESCRIPTION>
<CATEGORY>ED</CATEGORY>
<CLASSIFICATION>Non-Alcoholic Drink</CLASSIFICATION>
<SUB_CATEGORY></SUB_CATEGORY>
<PLACEMENT>1</PLACEMENT>
<DEPARTMENT>0</DEPARTMENT>
<REV_ACCT>200</REV_ACCT>
<ISSU_UNT_CST>0</ISSU_UNT_CST>
<ISSU_UNT_MEA>EA</ISSU_UNT_MEA>
 <PRICING>
 <LIST_TYPE>F</LIST_TYPE>
 <LIST_RATE>3.5</LIST_RATE>
 <LIST_TOGO>0</LIST_TOGO>
 <LIST_TOGOA>0</LIST_TOGOA>
 <LIST_ROOM>0</LIST_ROOM>
 <LIST_ROOMA>0</LIST_ROOMA>
 <LIST_BAR>0</LIST_BAR>
 <LIST_BARA>0</LIST_BARA>
 <LIST_CHILD>0</LIST_CHILD>
 <LIST_TEENS>0</LIST_TEENS>
 <LIST_SENIOR>0</LIST_SENIOR>
  <TAXES>
  <TAXRATE1>0</TAXRATE1>
  <TAXRATE2>0</TAXRATE2>
  <TAXRATE3>0</TAXRATE3>
  <PUR_UNT_MEA>EA</PUR_UNT_MEA>
  <PUR_UNT_CST>0</PUR_UNT_CST>
  <CNV_UM>1</CNV_UM>
  <REORDER_PT>0</REORDER_PT>
  <REORDER_QTY>0</REORDER_QTY>
  <STD_COST>0</STD_COST>
  <LEAD_TIME>0</LEAD_TIME>
  <QTY_ONHAND>-14</QTY_ONHAND>
  <QTY_ONORDER>0</QTY_ONORDER>
  <QTY_INSTOCK>0</QTY_INSTOCK>
  <LAST_SALE_DT>79636</LAST_SALE_DT>
  <ITEMSTATUS>A</ITEMSTATUS>
  <DISPLAYICON></DISPLAYICON>
  <TIMESSELECTED></TIMESSELECTED>
  <OVERRIDEGROUP1>0</OVERRIDEGROUP1>
  <OVERRIDEGROUP2>0</OVERRIDEGROUP2>
  <OVERRIDEGROUP3>0</OVERRIDEGROUP3>
  <OVERRIDEGROUP4>0</OVERRIDEGROUP4>
  <OVERRIDEGROUP5>0</OVERRIDEGROUP5>
  <OVERRIDEGROUP6>0</OVERRIDEGROUP6>
  <OVERRIDEGROUP7>0</OVERRIDEGROUP7>
  <OVERAMTGROUP1>0</OVERAMTGROUP1>
  <OVERAMTGROUP2>0</OVERAMTGROUP2>
  <OVERAMTGROUP3>0</OVERAMTGROUP3>
  <OVERAMTGROUP4>0</OVERAMTGROUP4>
  <OVERAMTGROUP5>0</OVERAMTGROUP5>
  <OVERAMTGROUP6>0</OVERAMTGROUP6>
  <OVERAMTGROUP7>0</OVERAMTGROUP7>
  <ORIDEPRINTER>0</ORIDEPRINTER>
  <EIGHTYSIX>0</EIGHTYSIX>
  <COUNTDOWN>0</COUNTDOWN>
  <ADDTIPLINE>0</ADDTIPLINE>
  <EXT_DESC></EXT_DESC>
  </TAXES>
 </PRICING>
</Record>

1 个答案:

答案 0 :(得分:1)

如果具有访问程序,则可以从外部数据导入中导入xml文件,并将其导出为Excel文件或文本文件。

访问导入xml enter image description here

导出Excel

enter image description here