Module Delimited


module Delimited: sig .. end
Parsers for delmited text formats, especially CSV. This module provides a record reader, field splitter, and printer. The delimiter, quoting, and whitespace behavior are all configurable.


type options = {
   field_sep : char; (*Parsers for delmited text formats, especially CSV. This module provides a record reader, field splitter, and printer. The delimiter, quoting, and whitespace behavior are all configurable.*)
   record_sep : char; (*Parsers for delmited text formats, especially CSV. This module provides a record reader, field splitter, and printer. The delimiter, quoting, and whitespace behavior are all configurable.*)
   trim_space : bool; (*Parsers for delmited text formats, especially CSV. This module provides a record reader, field splitter, and printer. The delimiter, quoting, and whitespace behavior are all configurable.*)
   rec_backslash : bool; (*Parsers for delmited text formats, especially CSV. This module provides a record reader, field splitter, and printer. The delimiter, quoting, and whitespace behavior are all configurable.*)
   rec_quotation : bool; (*Parsers for delmited text formats, especially CSV. This module provides a record reader, field splitter, and printer. The delimiter, quoting, and whitespace behavior are all configurable.*)
   rec_double_double : bool; (*Parsers for delmited text formats, especially CSV. This module provides a record reader, field splitter, and printer. The delimiter, quoting, and whitespace behavior are all configurable.*)
   rec_cr : bool; (*Parsers for delmited text formats, especially CSV. This module provides a record reader, field splitter, and printer. The delimiter, quoting, and whitespace behavior are all configurable.*)
   rec_escapes : bool; (*Parsers for delmited text formats, especially CSV. This module provides a record reader, field splitter, and printer. The delimiter, quoting, and whitespace behavior are all configurable.*)
   max_fields : int; (*Parsers for delmited text formats, especially CSV. This module provides a record reader, field splitter, and printer. The delimiter, quoting, and whitespace behavior are all configurable.*)
}
Options for parsing delimited text files.
val default_options : options
The default options. To read records with the default options but also recognizing backslash, one might write Csv.reader ~options:{default_options with recognize_backslash = true}.
val reader : ?options:options -> Pervasives.in_channel -> Reader.raw_line
The CSV reader. Splits a file into records, but doesn't interpret any quoting; that is, you get out what you put in.
val splitter : ?options:options -> string -> string array
The CSV splitter. Given a single CSV record, splits it into fields and interprets quoting and escaping properly to recover the original strings.
val output_field : ?options:options -> Pervasives.out_channel -> string -> unit
Output a single field, escaped as necessary for CSV.
val output_record : ?options:options -> Pervasives.out_channel -> string array -> unit
Output a CSV record, including the newline.