Skip to main content

delimiter

Supported in v1.7 and higher.

Definition

You can use this optional seed configuration to customize how you separate values in a seed by providing the one-character string.

  • The delimiter defaults to a comma when not specified.
  • Explicitly set the delimiter configuration value if you want seed files to use a different delimiter, such as "|" or ";".

Usage

Specify a delimiter in your dbt_project.yml file to customize the global separator for all seed values:

dbt_project.yml
seeds:
<project_name>:
+delimiter: "|" # default project delimiter for seeds will be "|"
<seed_subdirectory>:
+delimiter: "," # delimiter for seeds in seed_subdirectory will be ","

Or use a custom delimiter to override the values for a specific seed:

seeds/properties.yml
version: 2

seeds:
- name: <seed_name>
config:
delimiter: "|"

Examples

For a project with:

  • name: jaffle_shop in the dbt_project.yml file
  • seed-paths: ["seeds"] in the dbt_project.yml file

Use a custom delimiter to override global values

You can set a default behavior for all seeds with an exception for one seed, seed_a, which uses a comma:

dbt_project.yml
seeds:
jaffle_shop:
+delimiter: "|" # default delimiter for seeds in jaffle_shop project will be "|"
seed_a:
+delimiter: "," # delimiter for seed_a will be ","

Your corresponding seed files would be formatted like this:

seeds/my_seed.csv
col_a|col_b|col_c
1|2|3
4|5|6
...
seeds/seed_a.csv
name,id
luna,1
doug,2
...

Or you can configure custom behavior for one seed. The country_codes uses the ";" delimiter:

seeds/properties.yml
version: 2

seeds:
- name: country_codes
config:
delimiter: ";"

The country_codes seed file would be formatted like this:

seeds/country_codes.csv
country_code;country_name
US;United States
CA;Canada
GB;United Kingdom
...
0