Module Delimited.Write
Write CSVs & CSV-like delimited formats.
val empty : 'a t
val column : ('a -> string) -> header:string -> 'a t
val column_m : (module Core_kernel.Stringable.S with type t = 'a) -> header:string -> 'a t
val column_m_opt : ?default:string -> (module Core_kernel.Stringable.S with type t = 'a) -> header:string -> 'a option t
default
is printed in place ofNone
, and if not supplied is the empty string.
val of_list : 'a t list -> 'a t
val append : 'a t -> 'a t -> 'a t
val contra_map : 'b t -> f:('a -> 'b) -> 'a t
val map_headers : 'a t -> f:(string -> string) -> 'a t
val headers : 'a t -> string list
val to_columns : 'a t -> 'a -> string list
module Fields_O = Delimited_kernel.Write.Fields_O
Open for prefix operators useful for using with Fields.to_list.
module O = Delimited_kernel.Write.O
module By_row = Delimited_kernel.Write.By_row
module Expert = Delimited_kernel.Write.Expert
val of_writer : ?sep:char -> ?line_breaks:[ `Unix | `Windows ] -> write_header:bool -> 'a t -> Async.Writer.t -> 'a Async.Pipe.Writer.t
Make a pipe writer for
'a
s from a writer. The'a
s will be written out as CSVs.The writer will be closed when the pipe closes.
val create_writer : ?sep:char -> ?line_breaks:[ `Unix | `Windows ] -> write_header:bool -> 'a t -> string -> 'a Async.Pipe.Writer.t
Make a pipe writer for
'a
s from a filename. The'a
s will be written out as CSVs.The writer will be closed when the pipe closes.
module By_row : sig ... end