package csv

  1. Overview
  2. Docs
A pure OCaml library to read and write CSV files

Install

Dune Dependency

Authors

Maintainers

Sources

csv-2.4.tbz
sha256=13fec48177f2658c4c62edf04f5edd055962fbf2abb4c3e372d268dd2ab2a98e
sha512=a8a952315950fc7fcca36c758b69618296060fd4eab3140ac364ad62172cf665b3c0c9d892ddb586929217466a42f33f432e32e3bd0c1e549ea22bef6ef8a900

doc/csv/Csv/Row/index.html

Module Csv.RowSource

A row with a header.

Sourcetype t

Representation of a row whose columns are accessible both by indices and by headers names.

Sourceval get : t -> int -> string

get row i returns the ith column of the row. The first column has index 0. Since CSV allows a file to have rows of different lengths, this function never fails, it returns "" if the column does not exist.

Sourceval find : t -> string -> string

find row header return the value of the colum labelled with header (or "" if no such header has been declared).

Sourceval to_list : t -> string list

to_list row convert row to the usual representation, the list being in the column order.

Sourceval to_assoc : t -> (string * string) list

to_assoc row return an associative list of the row data as (header, value). If no header is given for a column, "" is used.

Sourceval with_header : t -> string list -> t

with_header row h return the row with headers h. If a name in h is "", the name present in row is used. If a name is duplicated.

OCaml

Innovation. Community. Security.