(** csv.mli - comma separated values parser * * $Id: csv.mli,v 1.1 2003-12-17 16:05:08 rich Exp $ *) type t = string list list (** Representation of CSV files. *) exception Bad_CSV_file of string (** Badly formed CSV files throw this exception: *) val lines : t -> int (** Work out the number of lines in a CSV file. *) val columns : t -> int (** Work out the (maximum) number of columns in a CSV file. Note that each line may be a different length, so this finds the one with the most columns. *) val load_in : in_channel -> t (** Load a CSV file. * @param chan Input file stream *) val load : string -> t (** Load a CSV file. * @param filename CSV filename. *) val load_rows : (string list -> unit) -> in_channel -> unit (** For very large CSV files which cannot be processed in memory at once, * this function is appropriate. It parses the input one row at a time and * calls your function once for each row. * * @param f Callout function. * @param chan Input file stream. *) val print : t -> unit (** Print string list list - same as [save_out stdout] *) val save_out : out_channel -> t -> unit (** Save string list list to a channel. *) val save : string -> t -> unit (** Save string list list to a file. *)