Module Csv.Record
Parameters
Signature
include Csvable_simple
val is_csv_atom : bool
true
ifcsvable
will be represented as a column, and its label is the field name of a containing record.
val rev_csv_header' : string list -> _ -> _ -> string list
A
Fields.fold
friendly version of a function to collect the csv header of thecsvable
type. The output is the header in reverse order.
val rev_csv_header_spec' : Spec.t list -> _ -> _ -> Spec.t list
val t_of_row' : _ -> string list -> (unit -> t) * string list
t_of_row' _ row
generates aFields.make_creator
friendly function that outputs a pair(creator, tail)
such thatcreator ()
generates the typet
with the first elements inrow
, andtail
is the remaining set of elements fromrow
that where not used in the creation oft
.
val write_row_of_t' : is_first:bool -> is_last:bool -> writer:(string -> unit) -> _ -> _ -> t -> unit
row_of_t'
has the same arguments asHelper.write
. The ignored arguments are used to make itFields.fold
friendly.
val csv_header_spec : Spec.t list
val t_of_row : string list -> t
t_of_row row
creates typet
from therow
.
val row_of_t : t -> string list
row_of_t t
creates arow
fromcsvable
.
val csv_load : ?separator:char -> string -> t list
The following functions are wrappers around the corresponding functions in
Csvlib.Csv
.
val csv_load_in : ?separator:char -> Core.In_channel.t -> t list
val csv_save_fn : ?separator:char -> (string -> unit) -> t list -> unit
val csv_save_out : ?separator:char -> Core.Out_channel.t -> t list -> unit
val csv_save : ?separator:char -> string -> t list -> unit