CSV Files
4 nodes
On this page 4
Parse CSV
FunctionA table from CSV text typed or pasted into the node - the quickest way to make a small table by hand.
Signature
ParseCSV -> Table
text: Text
delimiter: Text
header: Truth
inferTypes: Truth
skipRows: IntegerTable ParseCSV(
string text = "Name,Value\nAlpha,1\nBeta,2\nGamma,3",
string delimiter = "auto",
bool header = true,
bool inferTypes = true,
int skipRows = 0)Parameters
| name | type | default | description |
|---|---|---|---|
| text | Text | Name,Value Alpha,1 Beta,2 Gamma,3 | The CSV text. |
| delimiter | Text | auto | What separates the cells: "auto", or a comma, semicolon, "tab" or bar. |
| header | Truth | True | Whether the first line holds the column names. |
| inferTypes | Truth | True | Whether to read numbers, truths and dates as such. |
| skipRows | Integer | 0 | How many lines to pass over first. |
Returns
| Table | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- CSV Files
- Package
- Data Analytics
Read CSV
FunctionA table from a CSV file: a column per field, each read as numbers, truths or dates where every value reads as one, and as text otherwise. The delimiter is told from the file unless one is given.
Signature
ReadCSV -> Table
path: Text
delimiter: Text
header: Truth
inferTypes: Truth
skipRows: IntegerTable ReadCSV(
string path,
string delimiter = "auto",
bool header = true,
bool inferTypes = true,
int skipRows = 0)Parameters
| name | type | default | description |
|---|---|---|---|
| path | Text | — | The file. |
| delimiter | Text | auto | What separates the cells: "auto" to tell from the file, or a comma, semicolon, "tab" or bar. |
| header | Truth | True | Whether the first row holds the column names. |
| inferTypes | Truth | True | Whether to read numbers, truths and dates as such; everything is text otherwise. |
| skipRows | Integer | 0 | How many lines to pass over first - a title, notes above the table. |
Returns
| Table | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- CSV Files
- Package
- Data Analytics
To CSV
FunctionA table as CSV text.
Signature
ToCSV(table: Table, delimiter: Text, header: Truth) -> Text
string ToCSV(
Table table,
string delimiter = ",",
bool header = true)Parameters
| name | type | default | description |
|---|---|---|---|
| table | Table | — | The table. |
| delimiter | Text | , | What separates the cells: a comma, semicolon, "tab" or bar. |
| header | Truth | True | Whether to write the column names first. |
Returns
| Text | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- CSV Files
- Package
- Data Analytics
Write CSV
FunctionWrites a table to a CSV file - UTF-8 with a byte-order mark, so a spreadsheet reads accents correctly - and gives back the file's path.
Signature
WriteCSV -> Text
table: Table
path: Text
delimiter: Text
header: Truthstring WriteCSV(
Table table,
string path,
string delimiter = ",",
bool header = true)Parameters
| name | type | default | description |
|---|---|---|---|
| table | Table | — | The table. |
| path | Text | — | The file to write; its folder is created if need be. |
| delimiter | Text | , | What separates the cells: a comma, semicolon, "tab" or bar. |
| header | Truth | True | Whether to write the column names first. |
Returns
| Path | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- CSV Files
- Package
- Data Analytics