我有280,000行包含名为body
的列。此列包含xml数据。如何从XML列中提取数据到自己的列中?
一列值的副本如下所示。我需要将XML字段esn
,timestamp_utc
,Latitude
,Longitude
和triggers
的元素中包含的数据提取到新列中,列名与元素名称相同。
我曾经在这方面做过工作,但放弃了它。我不知道如何去做。请给我任何你可能有的建议。
谢谢!!!
<?xml version="1.0" encoding="UTF-8"?>
<telemetry>
<esn>1127877</esn>
<timestamp_utc>5/28/2011 9:18:30 PM</timestamp_utc>
<latitude>59.023672</latitude>
<longitude>-118.836408</longitude>
<ignition>N</ignition>
<geofence>0</geofence>
<speed>0</speed>
<heading>0</heading>
<milestraveled>0.00</milestraveled>
<triggers>Contact_State_Change, IO_1_Closed, No_Vibration_Detected, </triggers>
<miscellaneous>Standard3</miscellaneous>
<contact1counts>0</contact1counts>
<contact2counts>0</contact2counts>
<io1state>0</io1state>
<io2state>0</io2state>
</telemetry>
如果您发布代码,XML或数据样本,**请**在文本编辑器中突出显示这些行,然后单击编辑器工具栏上的“代码示例”按钮(“{}”)以精确地设置格式和语法突出显示它! –
谢谢!我知道我把它弄错了。 – John