Mudanças entre as edições de "Convertendo de XML para CSV"

De Basef
Ir para: navegação, pesquisa
 
Linha 8: Linha 8:
 
xml2csv --input /path/to/xml/file.xml --output /path/to/destination/file.csv --tag tagname
 
xml2csv --input /path/to/xml/file.xml --output /path/to/destination/file.csv --tag tagname
 
</source>
 
</source>
 +
 +
  
 
Pode ser necessário lêr o início e fim do arquivo XML. Os comandos `head` e `tail` podem ser usados:
 
Pode ser necessário lêr o início e fim do arquivo XML. Os comandos `head` e `tail` podem ser usados:

Edição atual tal como às 16h13min de 18 de abril de 2016

  • Instalar o programa xml2csv:
sudo pip install xmlutils
  • Rodar a conversão (substituir `tagname` pela TAG XML pai):
xml2csv --input /path/to/xml/file.xml --output /path/to/destination/file.csv --tag tagname


Pode ser necessário lêr o início e fim do arquivo XML. Os comandos `head` e `tail` podem ser usados:

head -c 1000 /path/to/xml/file.xml
tail -c 1000 /path/to/xml/file.xml