X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=csv.mli;h=ef061e6773d239d58a63ae0765b52170b486ff09;hb=bde8fd1d0283f16620624155a9bfb0b4e67feca9;hp=a8e570db10ff07a43b7c00267a73c04f86f0d25f;hpb=f6dbacda332fa9a11a36b3424516409d387058a1;p=ocaml-csv.git diff --git a/csv.mli b/csv.mli index a8e570d..ef061e6 100644 --- a/csv.mli +++ b/csv.mli @@ -1,6 +1,6 @@ (** csv.mli - comma separated values parser * - * $Id: csv.mli,v 1.6 2005-11-25 14:06:58 rich Exp $ + * $Id: csv.mli,v 1.8 2006-02-23 15:24:25 rich Exp $ *) type t = string list list @@ -69,7 +69,7 @@ val square : t -> t (** Make the CSV data "square" (actually rectangular). This pads out * each row with empty cells so that all rows are the same length as * the longest row. After this operation, every row will have length - * {!columns}. + * {!Csv.columns}. *) val is_square : t -> bool @@ -105,6 +105,13 @@ val sub : int -> int -> int -> int -> t -> t * The returned CSV will be square. *) +val compare : t -> t -> int +(** Compare two CSV files for equality, ignoring blank cells at the end + * of a row, and empty rows appended to one or the other. This is + * "semantic" equality - roughly speaking, the two CSV files would + * look the same if opened in a spreadsheet program. + *) + val to_array : t -> string array array val of_array : string array array -> t (** Convenience functions to convert to and from a matrix representation. @@ -133,7 +140,7 @@ val associate : string list -> t -> (string * string) list list * etc. ] * v} * - * Each row is turned into an assoc list (see {!List.assoc}). + * Each row is turned into an assoc list (see [List.assoc]). * * If a row is too short, it is padded with empty cells ([""]). If * a row is too long, it is truncated. @@ -161,9 +168,10 @@ val save : ?separator:char -> string -> t -> unit val print_readable : t -> unit (** Print the CSV data to [stdout] in a human-readable format. Not much * is guaranteed about how the CSV is printed, except that it will be - * easier to follow than a "raw" output done with {!print}. This is + * easier to follow than a "raw" output done with {!Csv.print}. This is * a one-way operation. There is no easy way to parse the output of * this command back into CSV data. *) val save_out_readable : out_channel -> t -> unit -(** As for {!print_readable}, allowing the output to be sent to a channel. *) +(** As for {!Csv.print_readable}, allowing the output to be sent to a channel. + *)