Up

Module Csv

proper csv file parsing is different than general delimited file parsing and requires special handling code

Signature

val create_manual : ?strip:bool -> ?sep:char -> header:Header.t -> unit -> ([
| `Data of string
| `Eof
] -> Row.t list) Core.Std.Staged.t

create_manual ?strip ~header r returns a function that allows you to feed strings into it, receiving back the rows as they are finished.

It is explicitly allowed to pass Eof, then more data. This is useful when tailing a file or when joining multiple files together.

val of_reader : ?strip:bool -> ?skip_lines:int -> ?sep:char -> header:Header.t -> Async.Std.Reader.t -> Row.t Async.Std.Pipe.Reader.t

of_reader ?strip ~header r returns a row pipe based on data read from the provided reader.

val create_reader : ?strip:bool -> ?skip_lines:int -> ?sep:char -> header:Header.t -> string -> Row.t Async.Std.Pipe.Reader.t Async.Std.Deferred.t

create_reader ?strip ~header filename same as of_reader, but creates the reader for you

val of_writer : ?sep:char -> Async.Std.Writer.t -> string list Async.Std.Pipe.Writer.t
val create_writer : ?sep:char -> string -> string list Async.Std.Pipe.Writer.t Async.Std.Deferred.t