A system gives you a report as an XML file, and your spreadsheet shows either an error or an unreadable tree. XML stores data as nested tags, while a spreadsheet wants rows and columns. The XML to CSV Converter flattens it for you, in your browser.
XML to CSV Converter FREE online toolRuns in your browser. No sign-up, nothing to install. Open the tool →Why XML is awkward in a spreadsheet
XML describes data with tags, and records can contain other records. A spreadsheet is flat: one row per record, one column per field. For a file with a repeating element such as invoice or transaction, each repetition becomes a row and its child elements become columns. That conversion works well when the structure is regular.
Complicated, deeply nested files need more thought, because one record can contain a list of items inside it.
Convert the file
- Open the XML file in a text editor and copy its content, or open the file directly in the converter.
- Look at the output to confirm that rows and columns look like your data.
- Check that the header row names make sense.
- Copy or download the CSV.
- Open it in your spreadsheet, or import it so you can choose the delimiter and column types.
Handle nested data
If each order contains several lines, the converter puts repeated child values into one cell, separated by semicolons, and joins nested element names with dots in the header. Look at what happens to your own data before relying on totals. The converter picks the first repeating level it finds as the row, so check whether that is the level you want, the order or the line item. It is the main decision in the whole job.
If the structure is too tangled, you might convert only the part you need by copying that section of the XML on its own.
Spreadsheet import traps
- Long numbers such as account or invoice numbers displayed in scientific notation.
- Leading zeros disappearing from codes.
- Dates turned into the wrong format by regional settings.
- Special characters showing incorrectly because of encoding. Choose UTF-8 on import.
- Decimal commas and thousands separators confusing number columns.
Using the import dialog
When a spreadsheet opens a CSV by double click, it guesses the types. Use the import or text-to-columns feature instead, and mark identifier columns as text. It takes a minute and prevents the most common silent corruption.
A small example
Take a file with three order elements, each containing id, date, and total. The converter produces a header row of id, date, total and three lines of values. Open it in a spreadsheet, add a SUM for the total column, and you have a quick check against the figure in the original report. If the sum differs, a record was skipped or doubled, and you want to know before sending the data on.
When you have thousands of records, test a handful first, then convert the full file.
Keep the original
The CSV is a convenience copy. Keep the XML file, since it is the official export, and note which system and date it came from. If someone questions a number later, you can go back to the source and check it.
Comments (0)
No comments yet. Be the first to share a thought.