This is a pure OCaml library to read and write CSV files, including all extensions used by Excel — e.g. quotes, newlines, 8 bit characters in fields, "0 etc. A special representation of rows of CSV files with a header is provided. This version can be used with the monadic concurrency library LWT.
The comma-separated values format — or CSV for short — is a simple tabular format supported by all major spreadsheets. This library implements pure OCaml functions to read and write files in this format (including Excel extensions) as well as some convenience functions to manipulate such data.
Compile & install
The easiest way to install this library is to use OPAM:
opam install csv
for the standard version and
opam install csv-lwt
for the LWT one. If you prefer to compile and install by hand, make sure you have dune and run
dune build @install dune install csv dune install csv-lwt
For the command line manipulation utility, do
opam install csvtool
dune install csvtool
opam remove csv opam remove csv-lwt opam remove csvtool
Manually (from the source directory):
dune uninstall csv dune uninstall csv-lwt dune uninstall csvtool
Also see the examples.