2.4 Export XML data to Microsoft Excel
For exporting XML data from a Swift Document to Microsoft Excel (XLS) format, use the exportXLS action as shown below: The following command exports all tables and queries in the Swift Document ‘Data.xdb’ to an Excel spreadsheet ‘Data.xls’.
|
You can specify specific tables and/or queries to export by listing them out on the command line as shown.
|
Please note that if a query has the same name as an existing table, the query will be exported. To have the table of the same name to be exported instead, please prepend the table name with a ^ as follows:
|
By default, existing output files will not be overwritten. To overwrite the output file (‘Data.xls’), use the -w option:
|
Output Type
When exporting to Microsoft Excel, Swift supports two types of output:
-
The default output type inserts data from all specified tables and/or
queries into a single sheet within the workbook. For example, the
following command creates such an output:
SwiftCmd.exe -w exportXLS Data.xdb Data.xls -
A different type of output is supported (selected with the ‘-x’
option) that creates a separate worksheet for each exported table
and/or query. For some applications this option might work
better. Here is how you could use it. Note the ‘-x’ option.
SwiftCmd.exe -w -x exportXLS Data.xdb Data.xls

