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 and headers
Section titled “Delimiter and headers”- 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 thedelimiterparameter 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.
Format and limits
Section titled “Format and limits”- Every column read is text (
string): convert withnum(...),toInt(...)orparseDouble(...)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.
Activities
Section titled “Activities”| Activity | Type | Output | What it does |
|---|---|---|---|
| Read CSV | read-csv | DataTable | Reads a CSV into a DataTable |
| Write CSV | write-csv | string | Writes a DataTable to a CSV |