Skip to content

CSV

A CSV file, or Comma-Separated Values file, is a simple type of spreadsheet or database file. It's a way to store and share data in a structured format that's easy for computers to read and understand. Each line of the file is a data record. Each record consists of one or more fields, separated by commas.

A CSV file typically stores tabular data in plain text, in which case each line will have the same number of fields. Alternative delimiter-separated files are often given a ".csv" extension despite the use of a non-comma field separator.

CSV parameters

Required parameters are in red and Optional parameters are in blue.


  • directory, the folder location to write CSV files to

  • delimiter, a one-character string used to separate fields
    default: |

  • escape_character, a one-character string used to escape the delimiter
    default: \\ ( if the escape character is itself, it must be escaped as well )

  • empty_as_null, whether or not to convert empty strings to the None sentinel
    default: false ( allowed: true, false )

  • quoting, how to quote individual cell values
    default: MINIMAL ( allowed: ALL, MINIMAL )

  • date_time_format, the string representation of date times
    default: %Y-%m-%d %H:%M:%S ( use the strftime.org cheatsheet as a guide )

  • header, whether or not to write the column headers as the first row
    default: true ( allowed: true, false )

  • save_strategy, how to save new data into an existing directory
    default: OVERWRITE ( allowed: APPEND, OVERWRITE )
How do I use the CSV syncer in commands?

cs_tools tools searchable bi-server --syncer csv://directory=.&header=false&save_strategy=APPEND

- or -

cs_tools tools searchable bi-server --syncer csv://definition.toml

Definition TOML Example

definition.toml

[configuration]
directory = '...'
delimiter = '|'
escape_character = '\'
save_strategy = APPEND