* Compliant simple CSV writter. * * This library is designed to deal with proper CSV (no quotes allowed in the * middle of the fields...). It is fast and flexible: by splitting most * writing functions in two parts one that gives the length of the string to * write and another that writes the result in a subpart of another string we * avoid unnecessary string creations.
val output_lines : ?quote:char ‑> ?sep:char ‑> ?eol:[ `Dos | `Unix ] ‑> Pervasives.out_channel ‑> string list list ‑> unit
Prints a valid csv file to a given channel.
The eol
arg can be used to override the default line ending
of "\r\n" (DOS line endings).
Example ~eol:`Unix to get *nix line endings
val line_to_string : ?quote:char ‑> ?sep:char ‑> string list ‑> string
Convert one CSV line to a string.
val maybe_escape_field : ?quote:char ‑> ?sep:char ‑> string ‑> string
Escape the a CSV field if need be.
val escape_field : ?quote:char ‑> string ‑> string
Escape a CSV (even if doesn't have any characters that require escaping).