# Comma Separated Values (CSV)

The target-csv loader loads extracted data into Comma Separated Values (CSV) files.

To learn more about target-csv, refer to the repository at https://github.com/singer-io/target-csv.

# Getting Started

# Prerequisites

If you haven't already, follow the initial steps of the Getting Started guide:

  1. Install Meltano
  2. Create your Meltano project
  3. Add an extractor to pull data from a source

# Installation and configuration

# Using the Command Line Interface

  1. Add the target-csv loader to your project using meltano add:

    meltano add loader target-csv
    
  2. Configure the settings below using meltano config.

# Using Meltano UI

  1. Start Meltano UI using meltano ui:

    meltano ui
    
  2. Open the Loaders interface at http://localhost:5000/loaders.

  3. Click the "Add to project" button for "Comma Separated Values (CSV)".

  4. Configure the settings below in the "Configuration" interface that opens automatically.

# Next steps

Follow the remaining step of the Getting Started guide:

  1. Run a data integration (EL) pipeline

# Settings

target-csv requires the configuration of the following settings:

These and other supported settings are documented below. To quickly find the setting you're looking for, use the Table of Contents in the sidebar.

# Minimal configuration

A minimal configuration of target-csv in your meltano.yml project file will look like this:






 
 

plugins:
  loaders:
  - name: target-csv
    variant: singer-io
    pip_url: target-csv
    config:
      destination_path: my_csv_files

# Destination Path

Sets the destination path the CSV files are written to, relative to the project root.

The directory needs to exist already, it will not be created automatically.

To write CSV files to the project root, set an empty string ("").

# How to use

Manage this setting using Meltano UI, meltano config, or an environment variable:

meltano config target-csv set destination_path <path>

export TARGET_CSV_DESTINATION_PATH=<path>

# Delimiter

  • Name: delimiter
  • Environment variable: TARGET_CSV_DELIMITER
  • Options: Comma (,), Tab (\t), Semi-colon (;), Pipe (|)
  • Default: ,

A one-character string used to separate fields.

# How to use

Manage this setting using Meltano UI, meltano config, or an environment variable:

meltano config target-csv set delimiter ";"

export TARGET_CSV_DELIMITER=";"

# QuoteChar

  • Name: quotechar
  • Environment variable: TARGET_CSV_QUOTECHAR
  • Options: Single Quote ('), Double Quote (")
  • Default: '

A one-character string used to quote fields containing special characters, such as the delimiter or quotechar, or which contain new-line characters.

# How to use

Manage this setting using Meltano UI, meltano config, or an environment variable:

meltano config target-csv set quotechar '"'

export TARGET_CSV_QUOTECHAR='"'