Why convert XML to TSV instead of CSV
An XML to TSV conversion produces the same rows and columns as CSV, but separates values with tab characters. That small difference has a practical benefit: when you copy tab-separated text and paste it into Excel, Google Sheets or Numbers, each value lands in its own cell immediately, without an import dialog. Commas in names, addresses and prices do not need quotes, because the comma is not the separator.
Example
<catalog>
<book id="bk101"><author>Gambardella, Matthew</author><price>44.95</price></book>
<book id="bk102"><author>Ralls, Kim</author><price>5.95</price></book>
</catalog>
Output (tabs shown as wide gaps):
@id author price
bk101 Gambardella, Matthew 44.95
bk102 Ralls, Kim 5.95
Compare this with CSV, where both author names would need to be wrapped in quotes. TSV is also the format many command-line tools and database bulk loaders read by default, which makes it a convenient intermediate step for data pulled out of XML exports.
How rows and columns are built
Each repeated record element, <book> here, becomes one row. Attributes become columns with the attribute prefix (@id); clear the prefix field for plain names. Nested elements become dot-notation columns such as address.city when Flatten nested objects is on, or JSON text in a single cell when it is off. Include header row controls whether the first line lists the column names.
When quoting still happens
TSV has one weak spot: values that themselves contain a tab or a line break. Those are wrapped in double quotes so the row structure stays intact, and most spreadsheet apps read them correctly. In XML data this mostly affects multi-line descriptions. If you plan to process the file with simple line-based tools like cut or awk, check such fields first.
Loading the TSV into other tools
Tab-separated output is read by many data tools with little or no configuration:
-- MySQL: tab is the default field separator
LOAD DATA LOCAL INFILE 'books.tsv' INTO TABLE books IGNORE 1 LINES;
-- PostgreSQL: CSV mode with a tab delimiter also handles quoted values
\copy books FROM 'books.tsv' WITH (FORMAT csv, DELIMITER E'\t', HEADER true)
# Python with pandas
df = pd.read_csv("books.tsv", sep="\t")
# Shell: print the author column
cut -f2 books.tsv
Using PostgreSQL's CSV mode rather than its plain text format matters here, because it understands the double quotes that the converter adds around values containing tabs or line breaks. Keep Include header row on whenever the loader can skip or use a header, so the column names travel with the data.
Picking the right sibling tool
- XML to CSV – when an importer requires CSV or you need a semicolon or pipe delimiter.
- XML to Excel – when you want a real .xlsx file with a named sheet.
- XML to HTML table – when the data should appear on a web page.
Privacy
The conversion runs locally in your browser. Only Load URL and Save & Share involve our server.