novixys

Exult Standard

Convert XML into Microsoft Excel (XLS), Microsoft Access (MDB or ACCDB), or CSV.

Download
a Free Trial
Buy Now
for US$150 $105

Exult SQL Server

Import XML into SQL Server.

Download
a Free Trial
Buy Now
for US$250

Exult MySQL

Import XML into MySQL.

Download
a Free Trial
Buy Now
for US$195 $125

Exult Oracle

Import XML into Oracle.

Download
a Free Trial
Buy Now
for US$500

Home » Documentation » Exult

4.1.5 Convert XML to CSV from the command line

Exult can convert XML data to CSV. Two methods of extracting XML to CSV are supported.

You can extract the data in all tables to a single CSV file. Each table is extracted in the following order: table name, followed by column names, followed by the data itself. You may want to use this method of extraction when you intend use an application such as Microsoft Excel to further massage the data. Use the ‘-f’ option to specify an output CSV file as shown here.

Exutlcmd.exe -t CSV -f sales.csv sales.xml

The other method of extraction is to extract each table to a separate CSV file. In this case, each file contains the column names followed by the data. This format is especially suitable for loading the XML data into a database. For this output method, you need to specify an output directory using the ‘-d’ option as shown:

Exutlcmd.exe -t CSV -d outputDir sales.xml

To merge the data from multiple XML files and extract the merged data to CSV (in a single file), use the following command:

Exultcmd.exe -t CSV -f sales.csv sales*.xml

Convert XML files in multiple directories and extract to CSV (each table to a separate CSV file):

Exultcmd.exe -t CSV -d outputDir C:\Path\DirA\*.xml C:\DirB\*.xml

Note: If you want to convert XML to CSV for the purpose of loading into a database, we have versions of Exult for SQL Server, Oracle and MySQL.

Advantages of using these products include:

That being said, it is sometimes more convenient to load data from the CSV. One reason is that the CSV option offers you more control over the import process, including being able to name the tables and columns whatever you want.