Render an array or tree of objects in CSV (comma-separated values) format in compliance with RFC 4180.
The first object is taken as representative of the set, and its properties used to establish both the header and which properties of all objects will be included in the output. Per RFC 4180, the line breaks are carriage return and line feed characters.
# catBreeds.yaml
- breed: Siamese
origin: Thailand
size: medium
coat: short
temperament: Vocal and Social
- breed: Persian
origin: Iran
size: medium
coat: long
temperament: Calm and Affectionate
- breed: Maine Coon
origin: United States
size: large
coat: long
temperament: Gentle and Friendly
- breed: Sphynx
origin: Canada
size: medium
coat: hairless
temperament: Curious and Social
$ ori csv catBreeds.yaml
breed,origin,size,coat,temperament
Siamese,Thailand,medium,short,Vocal and Social
Persian,Iran,medium,long,Calm and Affectionate
Maine Coon,United States,large,long,Gentle and Friendly
Sphynx,Canada,medium,hairless,Curious and Social
See also support for unpacking .csv files.