# export

## Overview

The `export` statement is used to snapshot the data in a DSET and write it to disk as a Dataset.

## Syntax

**`export`***`source.alias`***`as`***`filename`*

## Details

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.

### Exporting usage

The `source.alias` argument is the DSET ID to export (see [Core concepts](/3.5.4/advanced/digging-deeper/dataset-lifecycle.md) for more information on DSET IDs).

The `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

## Examples

{% hint style="info" %}
When specifying a Windows path it is advisable to use UNIX-style forward slashes as the path delimiters, or to put the path+filename in double quotes to avoid occurrences of`\t` being interpreted as a TAB character
{% endhint %}

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
option noquote

# Will be exported as <basedir>\exported\azure\flagged.csv
export azure.usage as "azure\flagged.csv"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://olddocs.exivity.io/3.5.4/data-pipelines/transform/language/export.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
