# パラメータを使用したデータのエクスポート

ワークフローでエクスポートするデータを指定するときに、パラメータを含めることができます。

TDの公開[GitHubリポジトリ](https://github.com/treasure-data/workflow-examples/tree/master/td)で、インテグレーションのさまざまな設定例を確認できます。FTPを使用した結果出力の詳細なワークフロー例は、[GitHubリポジトリ](https://github.com/treasure-data/workflow-examples/tree/master/td/ftp)にあります。

ワークフローで使用するパラメータは、結果エクスポートタイプによって決まります。

## ワークフロー定義内の汎用コード例


```yaml
timezone: UTC

_export:
  td:
    database: sample_datasets

+td-result-into-target:
  td>: queries/sample.sql
  result_connection: your_connections_name
  result_settings:
    parameter1: value1
    parameter2: value2
    ....
```

## result_settingsを使用したFTP結果出力の例

Treasure ワークフローでは、FTPを介した結果出力の指定は以下のようになります：


```yaml
timezone: UTC

_export:
  td:
    database: sample_datasets

+td-result-via-ftp:
  td>: queries/sample.sql
  result_connection: ftp-out
  result_settings:
    path_prefix: /path/to/file
    sequence_format: ""
    file_ext: csv
    compression: None
    header_line: None
    delimiter: ","
    null_string: ""
    newline: CRLF
```

FTPを介した結果出力に適用できるパラメータは以下のとおりです：

| パラメータ | 説明 |
|  --- | --- |
| path_prefix | 出力パスのプレフィックス（string、必須） |
| file_ext | デフォルト: csv（string、（csvまたはtsv）） |
| sequence_format | 出力ファイルのシーケンス部分のフォーマット（string、デフォルト: `".%03d.%02d"`） |
| compression | デフォルト None（string（None|gz|bzip2）） |
| header_line | デフォルト true（boolean（true|false）） |
| null_string | デフォルト ""（string（""|"\N"|NULL|null）） |
| delimiter | デフォルト ","（string（","|"\t"|"tab"|"|"）） |
| newline | デフォルト CRLF（string（CRLF|CR|LF）） |