package csv-lwt

  1. Overview
  2. Docs

Module Csv_lwtSource

Lwt interface to the CSV library.

This module only offers Lwt input/output functions for CSV files. Csv provides additional functions to transform CSV data.

Sourcetype t = Csv.t

Input

Sourcetype in_channel

Stateful handle to input CSV files.

Sourceval of_channel : ?separator:char -> ?strip:bool -> ?has_header:bool -> ?header:string list -> ?backslash_escape:bool -> ?excel_tricks:bool -> ?fix:bool -> Lwt_io.input_channel -> in_channel Lwt.t
Sourceval load : ?separator:char -> ?strip:bool -> ?backslash_escape:bool -> ?excel_tricks:bool -> ?fix:bool -> string -> t Lwt.t
Sourceval load_in : ?separator:char -> ?strip:bool -> ?backslash_escape:bool -> ?excel_tricks:bool -> ?fix:bool -> Lwt_io.input_channel -> t Lwt.t
Sourceval close_in : in_channel -> unit Lwt.t

close_in ic closes the channel ic. The underlying channel is closed as well.

Sourceval next : in_channel -> string list Lwt.t
Sourceval fold_left : f:('a -> string list -> 'a Lwt.t) -> init:'a -> in_channel -> 'a Lwt.t
Sourceval fold_right : f:(string list -> 'a -> 'a Lwt.t) -> in_channel -> 'a -> 'a Lwt.t
Sourceval iter : f:(string list -> unit Lwt.t) -> in_channel -> unit Lwt.t

See Csv.inter.

Sourceval current_record : in_channel -> string list

Output

Sourcetype out_channel
Sourceval to_channel : ?separator:char -> ?backslash_escape:bool -> ?excel_tricks:bool -> ?quote_all:bool -> Lwt_io.output_channel -> out_channel
Sourceval close_out : out_channel -> unit Lwt.t
Sourceval output_record : out_channel -> string list -> unit Lwt.t
Sourceval output_all : out_channel -> t -> unit Lwt.t
Sourceval save : ?separator:char -> ?backslash_escape:bool -> ?excel_tricks:bool -> ?quote_all:bool -> string -> t -> unit Lwt.t
Sourceval print : ?separator:char -> ?backslash_escape:bool -> ?excel_tricks:bool -> ?quote_all:bool -> t -> unit Lwt.t

Functions to access rows when a header is present

Sourcemodule Row : module type of Csv.Row

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

Sourcemodule Rows : sig ... end
OCaml

Innovation. Community. Security.