The CSV library provides functions related to comma separated values.
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.
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.