This site has been deprecated. Do not edit pages here. Please visit the new Pico Labs documentation.


Skip to end of metadata
Go to start of metadata

The CSV library provides functions related to comma separated values. 

Functions

csv:from_array(<entry array>, <field array>)

Formats a CSV string from and array of maps.

This function takes an array of maps representing the entries to be formatted and an array with the desired fields.

If the field array is missing, all the fields in the maps will be returned.

The function assumes that each of the maps in the array have the same keys.  

Examples

Note that the order is the same regardless of the order of the keys in the maps. If you do not specify a field array, the order of the columns will be random. 

This example uses the same data, but specifies fields. 

In this case, only the fields specified are returned and in the specified order. 

Labels: