I am working with some XML data that I need to convert to a flat file so I can do statistical analysis. I am analyzing the data using R. Here is what a sample of the data looks like:
<production xmlns="" diffgr:id="production1130" msdata:rowOrder="1129">
<ENTITY_ID>116484210</ENTITY_ID>
<LIQ>0</LIQ>
<GAS>163</GAS>
<WTR>0</WTR>
<WCNT>1</WCNT>
<DAYS>0</DAYS>
</production>
<production xmlns="" diffgr:id="production1131" msdata:rowOrder="1130">
<ENTITY_ID>116484210</ENTITY_ID>
<LIQ>12</LIQ>
<GAS>130</GAS>
<WTR>0</WTR>
<WCNT>1</WCNT>
<DAYS>0</DAYS>
</production>
I would like this to translate to a flat file that looks like this:
PRODUCTION_ID, ENTITY_ID, LIQ, GAS, WTR, WCNT, DAYS
Any suggestions?
Thanks, Z
Simple example:
Yields:
test.xml being: