Convert XML to CSV
Learn how to convert XML files into CSV files using a Convert XML to CSV data operation.
Last updated
Was this helpful?
Learn how to convert XML files into CSV files using a Convert XML to CSV data operation.
Last updated
Was this helpful?
The Convert XML to CSV data operation allows you to retrieve all the information contained in a possibly complex XML file into a set of CSV files, all located in a Google Cloud Storage bucket. You can later convert your CSV files into database tables using a data operation.
Note that the XML file provided must be well-formed and valid against a matching XSD file (defining its elements and attributes, and the rules that apply to them).
The XML and XSD file must have the same name (suffix excluded). Refer to for more details.
If the XML file contains entities not set in the XSD, then the corresponding data will not be exported to CSV files.
XML + XSD file pair(s)
Multiple TSV (Tab Separated Values) + DDL file pairs
Every time a new file matching the specified XML file name pattern appears in a given directory of a Google Cloud Storage bucket:
The XML file is checked against the matching XSD file.
If the XML file is valid, the conversion process is launched.
A set of CSV files with their matching DDL files (describing their schema) is generated in the working directory.
The source XML files are deleted from the working directory.
If set, a filtering occurs at the end of the process to remove unwanted CSV files.
Create a working folder as you want, and create a JSON file for your data operation inside.
Place the XSD file in the same location as your JSON file.
Access your working folder by running the following command:
To deploy the data operation, run the following command:
For your Convert XML to CSV data operation to be executed, you need to place a file into the source folder.
Access the GCS bucket to check your output files (CSV and DDL files).
Access your tailer folder (created during ).
Prepare your JSON configuration file. Refer to this page to learn about all the .
Log in to to check the status and details of your data operation.