9 The csv library
This library provides a function for reading comma-separated values (CSV) files.
procedure
Reads the CSV file input and returns its contents as a vector of vectors of strings. The outer vector has one element for each row in the file, and each row has one element for each column in the row. Individual cells are represented as strings.
For example, a CSV file containing the following:
state,initial,capital |
Illinois,IL,Springfield |
Massachusetts,MA,Boston |
Missouri,MO,Jefferson City |
would be read into:
[['state', 'initial', 'capital'], ['Illinois', 'IL', 'Springfield'], ['Massachusetts', 'MA', 'Boston'], ['Missouri', 'MO', 'Jefferson City']]
procedure
Reads the CSV file input and returns the contents of its first row, which are assumed to be column headers.
procedure
Reads the CSV file input and returns the contents of its second and later rows, skipping the first (which is assumed to contain column headers).