Converter arquivo xml para csv no script de shell?
Eu estou tentando converter um arquivo xml para um arquivo csv. Eu tenho um arquivo xml de entrada como este:
<Row>
<Cell>
<Data Type="String" >START</Data>
</Cell>
<Cell>
<Data Type="DateTime" >2013-01-15T21:30:42</Data>
</Cell>
<Cell>
<Data Type="String" ></Data>
</Cell>
<Cell>
<Data Type="String" >Start 'suite8'</Data>
</Cell>
<Cell>
<Data Type="String" >Test 'suite8' started</Data>
</Cell>
<Cell>
<Data Type="String" ></Data>
</Cell>
</Row>
<Row/>
<Row>
<Cell>
<Data Type="String" >START_TEST_CASE</Data>
</Cell>
<Cell>
<Data Type="DateTime" >2013-01-15T21:30:42</Data>
</Cell>
<Cell>
<Data Type="String" ></Data>
</Cell>
<Cell>
<Data Type="String" >Start 'case1'</Data>
</Cell>
<Cell>
<Data Type="String" >Test Case 'case1' started</Data>
</Cell>
<Cell>
<Data Type="String" >case1</Data>
</Cell>
</Row>
Estou interessado nos bits entre as tags<Data Type="String" >
e</Data>
. Além disso, uma nova linha deve ser iniciada quando a tag<Row>
aparece.
O arquivo csv de saída que eu quero deve ficar assim:
START,2013-01-15T21:30:42,,Test 'suite8' started
START_TEST_CASE,2013-01-15T21:30:42,,Start 'case1',Test Case 'case1' started,case1
Espero que isso seja claro o suficiente, qualquer ajuda é muito apreciada :) Obrigado!