package csv-lwt

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Represent a row with header. Compatible with Csv.Row.

A row with a header.

type t

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

val 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.

val find : t -> string -> string

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

val to_list : t -> string list

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

val 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.

val 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.