package csv

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

Install

Dune Dependency

Authors

Maintainers

Sources

csv-2.0.tbz
sha256=f7077c3928c3e36b207c06bd2e82625f5a92c480144f48ecc92e16c697d7ddbc
md5=b21dff064ec2151923cce97564688ea5

doc/csv/Csv/Rows/index.html

Module Csv.RowsSource

Accessing rows (when a header was provided).

Sourceval header : in_channel -> string list

The header declared for this channel.

Sourceval set_header : ?replace:bool -> in_channel -> string list -> unit

set_header ic headers set the new header for all subsequent reads on ic (previously read Row.t values are unaffected). This is useful for example to compose an unusual header after reading several lines of the CSV data.

  • parameter replace

    When false (the default), if an entry in headers is "", the previous name (if any) is kept (see the header parameter of of_in_obj). When true, an entry "" means there is no access by name for that column.

Sourceval next : in_channel -> Row.t

See Csv.next. If no header was declared for the channel, this function will work but only access using Row.get will work.

Sourceval fold_left : f:('a -> Row.t -> 'a) -> init:'a -> in_channel -> 'a
Sourceval fold_right : f:(Row.t -> 'a -> 'a) -> in_channel -> 'a -> 'a
Sourceval iter : f:(Row.t -> unit) -> in_channel -> unit
Sourceval input_all : in_channel -> Row.t list
Sourceval load : ?separator:char -> ?strip:bool -> ?has_header:bool -> ?header:string list -> ?backslash_escape:bool -> ?excel_tricks:bool -> ?fix:bool -> string -> Row.t list
OCaml

Innovation. Community. Security.