Skip to content

CSV

The CSV Operator enables working with CSV (Comma-Separated Values) files. It provides functionality for reading CSV files, extracting headers, converting data to CSV format, and parsing CSV content into structured data.

  • Importing data from CSV files
  • Exporting data to CSV format
  • Analyzing CSV file structure
  • Converting between CSV and structured data formats
  • Processing tabular data
  • Data migration between systems
  • Generating reports in CSV format

Returns the CSV header of the input file, including column names and inferred data types.

  • file (FileDto): The CSV file to analyze
  • delimiter (char): The character used to separate values (default is comma)
  • quoteChar (string): The character used for quoting values
  • escapeChar (string): The character used for escaping special characters
  • encoding (string): The character encoding of the file
  • useHeader (boolean): Whether to use the first row as header
  • skipEmptyLines (boolean): Whether to skip empty lines
  • trimWhitespace (boolean): Whether to trim whitespace from values

Returns a Map where keys are column names and values are the inferred data types (String, Integer, Double, Boolean).

Converts an input object to a CSV file. Uses object fields/elements as columns.

  • value (Object): The data to convert to CSV format
  • delimiter (char): The character used to separate values
  • quoteChar (string): The character used for quoting values
  • escapeChar (string): The character used for escaping special characters
  • encoding (string): The character encoding to use
  • useHeader (boolean): Whether to include a header row

Returns a FileDto object containing information about the created CSV file, including:

  • id (string): The unique identifier of the file
  • name (string): The file name (default is “data.csv”)
  • contentType (string): The content type (“text/csv”)
  • size (long): The file size in bytes
  • organizationId (string): The organization ID associated with the file

Reads a provided CSV file and converts it to structured data.

  • file (FileDto): The CSV file to read
  • delimiter (char): The character used to separate values
  • quoteChar (string): The character used for quoting values
  • escapeChar (string): The character used for escaping special characters
  • encoding (string): The character encoding of the file
  • useHeader (boolean): Whether to use the first row as header
  • skipEmptyLines (boolean): Whether to skip empty lines
  • trimWhitespace (boolean): Whether to trim whitespace from values

Returns a List of objects representing the CSV data. If useHeader is true, each row is represented as a Map with column names as keys. Otherwise, each row is represented as an array of values.

  • When reading CSV files, the operator can infer data types for columns
  • When writing CSV files, complex objects are converted to strings
  • Empty lines can be automatically skipped during processing