Convert XML to CSV
Turn XML files into CSV. The first list of repeated elements, such as the items of a feed, becomes the rows, with one column per child element or attribute, attributes starting with @.
Converted in an isolated sandbox on our serversDeleted after 24 hours
Drop XML files on the dialor turn it to pick what to do
A table from your XML feed.Repeated elements become rows. Each child element or attribute becomes a column.
What you get
One CSV file. The first list of repeated elements in the XML, such as the items of a feed, becomes the rows of the table.
Each row has one column per child element or attribute. Attribute columns start with @, so they are easy to tell apart from columns made from elements.
Nested data
Nesting deeper than the row and its columns is written into the cell as JSON text. The cell holds that JSON, not a set of extra columns.
A document without repeated elements becomes one row.
When it stops
If the XML cannot be parsed, the conversion stops with
input_corrupted. The file is not turned into a table in that case.To go the other way, use CSV to XML.
XML and CSV.What each format is.
The formats
XML
XML documents and data.
- Extensions
- .xml
- MIME type
- application
/xml - Kind
- Text and data
CSV
Rows of comma-separated values. The plainest way to move a table between programs.
- Extensions
- .csv
- MIME type
- text
/csv - Kind
- Text and data
In your code.The same XML to CSV conversion through the API, for your app or your agent.
$ cv convert report.xml report.csv$ cv convert report.xml report.csvQuestions.What people ask about XML to CSV.
The first list of repeated elements becomes the rows. Each child element or attribute of those elements becomes a column.
It marks a column that comes from an attribute. Columns from child elements have no @.
They are written into the cell as JSON text. They do not become extra columns.
The document becomes one row.