to csv
for formats
Convert table into .csv text .
Signature
> to csv --separator --noheaders
Parameters
--separator {string}
: a character to separate columns, defaults to ','--noheaders
(-n)
: do not output the columns names as the first row
Input/output types:
input | output |
---|---|
record | string |
table | string |
Examples
Outputs an CSV string representing the contents of this table
> [[foo bar]; [1 2]] | to csv
foo,bar
1,2
Outputs an CSV string representing the contents of this table
> [[foo bar]; [1 2]] | to csv -s ';'
foo;bar
1;2
Outputs an CSV string representing the contents of this record
> {a: 1 b: 2} | to csv
a,b
1,2