CSV support in Pharo¶
Currently, Pharo provides one main framework to handle the CSV format: NeoCSV.
NeoCSV¶
NeoJSON is actually maintained by Sven Van Caekenberghe on github. This section shows some quick examples but there is a great documentation made by Sven and a chapter in Enterprise Pharo (chapter 7).
NeoCSV provides utilities to map Smalltalk objects to CSV lines, this page does not cover this topic to avoid duplication with the great documentation available in Sven's documentation and Enterprise Pharo (chapter 7). Check it out if you need to use such feature!
Install¶
To install NeoCSV, simply execute the following code snippet in a playground:
Parse CSV¶
-
From
String: -
From
Stream: -
Read from CSV file:
Generate CSV¶
Let data be defined as:
-
To generate a CSV
String: -
To generate CSV on a
Stream: -
To write a CSV file: