Hi,
I have an external file that consists of XML tags. I want to extract only those tags that have a valid value and get rid of the rest.
Here's an example:
My raw data file has the following data:
<Row>
<Cell ss:StyleID="s77"><Data ss:Type="String">Cost of Goods Sold</Data></Cell>
<Cell ss:StyleID="s77"/>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">2285.4549999999999</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">2087.239</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">2082.4839999999999</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">2537.913</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">4086.61</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
</Row>
I'm having a hard time figuring out how to get rid of unwanted rows. In the above case the final output should be:
<Row>
<Cell ss:StyleID="s77"><Data ss:Type="String">Cost of Goods Sold</Data></Cell>
<Cell ss:StyleID="s77"/>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">2285.4549999999999</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">2087.239</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">2082.4839999999999</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">2537.913</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">4086.61</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
</Row>
Could someone please help me on this one?
Many Thanks,
Jerry
I have an external file that consists of XML tags. I want to extract only those tags that have a valid value and get rid of the rest.
Here's an example:
My raw data file has the following data:
<Row>
<Cell ss:StyleID="s77"><Data ss:Type="String">Cost of Goods Sold</Data></Cell>
<Cell ss:StyleID="s77"/>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">2285.4549999999999</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">2087.239</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">2082.4839999999999</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">2537.913</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">4086.61</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
</Row>
I'm having a hard time figuring out how to get rid of unwanted rows. In the above case the final output should be:
<Row>
<Cell ss:StyleID="s77"><Data ss:Type="String">Cost of Goods Sold</Data></Cell>
<Cell ss:StyleID="s77"/>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">2285.4549999999999</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">2087.239</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">2082.4839999999999</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">2537.913</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="Number">4086.61</Data></Cell>
<Cell ss:StyleID="s76" ss:Formula="=IF(R[608]C="","",R[608]C)"><Data
ss:Type="String"></Data></Cell>
</Row>
Could someone please help me on this one?
Many Thanks,
Jerry