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
RowSpecmodule.
- 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.Makewith 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 -> tadd a row to the spreadsheet, overwriting an existing equal rowcount_rows : t -> intreturn the number of rows in the spreadsheetcreate : unit -> tcreate an empty spreadsheetread : ?skip_title:bool -> string -> tparse a spreadsheet from a filewrite : filename:string -> t -> unitwrite a spreadsheet to a file
Requires OCaml 4.02.0 for the Set.of_list function.