export statement is used to snapshot the data in a DSET and write it to disk as a Dataset.
The exported file will be created under
<base_dir>/exported. The filename parameter may include a path as well as the filename to export, so long as it does not contain the substring “..” and is not an absolute path. If the
path contains one or more directories that do not exist then they will be created.
source.alias argument is the DSET ID to export (see
Core concepts for more information on DSET IDs).
export statement can be used at any point during this process to save a CSV (conforming to Dataset format) which snapshots the data in the DSET at that moment in time. This can be used for a number of purposes including:
- Examining the state of data part-way through processing for debugging purposes
- Creating custom exports for subsequent import into 3rd part systems
- Producing output CSV files (which may potentially contain merged data from multiple sources) for subsequent processing with another Transcript
\tbeing interpreted as a TAB character.
The following Transcript will import a quoted CSV file, add a ProcessedFlag column to it with a value of 1 in each row, and save it back out again without quotes:
option quote = \"
use usage from azure
create column ProcessedFlag value 1
# Will be exported as <basedir>\exported\azure\flagged.csv
export azure.usage as "azure\flagged.csv"