CSV
Path:
/src/type/csv.coffee
compiled to/lib/type/csv.js
The CSV format should only be used with table like data which is in the form of a list of lists. See the table package to transform and work with such data.
Autodetection is not possible here.
Common file extension csv
.
num;type;object
1;null;
2;undefined;
3;boolean;1
4;number;5.6
5;text;Hello
6;quotes;"Give me a ""hand up"""
7;date;128182440000
8;list;[1,2,3]
9;object;"{""name"":""Egon""}"
10;complex;"[{""name"":""Valentina""},{""name"":""Nadine""},{""name"":""Sven""}]"
While some types are fully supported: string, number
Others are partly supported and won’t be automatically detectable:
- boolean as integer
- date as unix time integer
- null, undefined and empty strings are stored the same way and wil be red as null
And lastly complex sub objects will be stored as JSON text and be automatically parsed on read again.
Format Options:
columns
-Array
List of fields, applied when transform returns an object, order matters, columns are auto discovered in the first recorddelimiter
-String
Set the field delimiter (default: ‘;’)escape
-String
Set the escape character (Default: ‘"’)quote
-String
Optionnal character surrounding a field, one character only (Default: ‘"’)quoted
-Boolean
quote all the non-empty fields even if not required (default: false)quotedEmpty
-Boolean
quote empty fields? (default: false)quotedString
-Boolean
quote all fields of type string even if not required (default: false)
Parse Options:
delimiter
-String
Set the field delimiter (default: ‘;’)quote
-String
Optionnal character surrounding a field, one character only (Default: ‘"’)escape
-String
Set the escape character (Default: ‘"’)comment
-String
Treat all the characters after this one as a comment, default to ‘’ (disabled).