CSV is a delimited text format for tabular records. DuckDB can load CSV files in bulk and in parallel, automatically mapping columns while inferring usable schema information. section 1.7.1
CSV works well as a practical interchange format: convert source data into CSV, compress it when useful, and query it directly with DuckDB without first creating persistent tables. It also provides a portable artifact for tools that do not support the original format. section 10.1.1 section 5.0
Convert XML data to compressed CSV
A command-line pipeline extracts selected XML fields, converts the result through JSON to CSV, writes a header, and compresses the output: `7z e -so stackoverflow.com-Comments.7z | xidel ... | (echo "Id,PostId,Score,Text,CreationDate,UserId" && jq -r '. | @csv') | gzip -9 > Comments.csv.gz`.
Listing 10.1 Converting the XML file via JSON to CSV
7z e -so stackoverflow.com-Comments.7z | \ xidel -se '//row/[(@Id|@PostId|@Score|@Text|@CreationDate|@UserId)]' - | \ (echo "Id,PostId,Score,Text,CreationDate,UserId" && jq -r '. | @csv') | gzip -9 > Comments.csv.gz
Inspect the complete conversion command and its field-selection, header-generation, CSV-encoding, and compression stages. section 10.1.1














