Mudanças entre as edições de "Convertendo de XML para CSV"
De Basef
(Criou página com '* Instalar o programa xml2csv: <source lang="bash"> sudo pip install xmlutils </source> * Rodar a conversão (substituir `tagname` pela TAG XML pai): <source lang="bash"> xml...') |
|||
Linha 7: | Linha 7: | ||
<source lang="bash"> | <source lang="bash"> | ||
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> | ||
+ | |||
+ | Pode ser necessário lêr o início e fim do arquivo XML. Os comandos `head` e `tail` podem ser usados: | ||
+ | <source lang="bash"> | ||
+ | head -c 1000 /path/to/xml/file.xml | ||
+ | tail -c 1000 /path/to/xml/file.xml | ||
</source> | </source> | ||
[[Category:Linux Ubuntu]] | [[Category:Linux Ubuntu]] |
Edição das 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