我有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