Skip to content

CSV Activities

Version: 1.0.5  ·  ID: zoan-packages-csv  ·  Author: Zoan Software

The CSV package reads and writes CSV (comma-separated values) files using a DataTable. CSV is the most universal format for exchanging tabular data: almost any system exports and imports it. When you take data from one source and need to hand it to another, CSV is often the bridge.

  • Delimiter: although “CSV” means comma-separated, many files (especially in regional settings that use the comma as decimal separator) use a semicolon ; or a tab. Set the delimiter parameter to match your file. Only the first character counts; for a tab use the expression ((char)9).ToString().
  • Headers: by default the first row is treated as column names (hasHeader = true).
  • Quotes: a field in double quotes may contain the delimiter ("Smith, Ann"), and "" inside it stands for one quote. When writing, quotes are added automatically when needed.
  • Every column read is text (string): convert with num(...), toInt(...) or parseDouble(...) when you need numbers.
  • Each record must fit on one line: a quoted field containing line breaks is not read correctly.
  • Blank lines are ignored when reading.
  • By default files are read and written as UTF-8; when writing, the file gets the BOM, which helps Excel show accented characters correctly. Supported encodings: the same as in Files › encoding.
ActivityTypeOutputWhat it does
Read CSVread-csvDataTableReads a CSV into a DataTable
Write CSVwrite-csvstringWrites a DataTable to a CSV