Functor for working with spreadsheets. Generates spreadsheet functions from a spec for spreadsheet rows.
See the examples/
directory for sample code.
- Create an instance of the
RowSpec
module.
- Define a type for spreadsheet rows, give a string separator like
","
. - Write functions to parse a row from a list of columns, and write a row to columns.
- Give a title---a list of strings describing each column in a row.
- Call
Spreadsheet.Make
with yourRowSpec
. - Use the newly-created module to read a spreadsheet from a file, or make a new one and add rows to it.
Also see spreadsheet.mli
add_row : t -> row:RowSpec.t -> t
add a row to the spreadsheet, overwriting an existing equal rowcount_rows : t -> int
return the number of rows in the spreadsheetcreate : unit -> t
create an empty spreadsheetread : ?skip_title:bool -> string -> t
parse a spreadsheet from a filewrite : filename:string -> t -> unit
write a spreadsheet to a file
Requires OCaml 4.02.0 for the Set.of_list function.