Functions for reading from a ".xlsx" file.
You can get a specific cell’s value or loop for the whole sheet’s rows.
There is also a complete read and write example included in the GitHub source.
(with-input-from-xlsx-file xlsx_file_path user-proc) → void? xlsx_file_path : path-string? user-proc : (-> (is-a?/c read-xlsx%) void?)
This must be called before attempting to read any cell values.
xlsx_handler : (or/c (is-a?/c read-xlsx%) (is-a?/c xlsx%))
(with-input-from-xlsx-file "workbook.xlsx" (lambda (xlsx) (load-sheet "Sheet1" xlsx) (get-cell-value "C12" xlsx)))
The cell-axis should be in the “A1” reference style.
Limitations: Currently does not support array or shared formulae.
Date values in xlsx files are a plain number representing the count of days since 0 January 1900.
> (date->string (oa_date_number->date 43359.1212121))
"Monday, September 17th, 2018"
> (parameterize ([date-display-format 'rfc2822]) (date->string (oa_date_number->date 44921.5601)))
"Tue, 27 Dec 2022"
→ (cons/c positive-integer? positive-integer?) xlsx_handler : (or/c (is-a?/c read-xlsx%) (is-a?/c xlsx%))
(sheet-name-rows xlsx-file-path sheet-name)
→ (listof (listof (or/c string? number?))) xlsx-file-path : path-string? sheet-name : string?
This is the most simple function for reading xlsx data. Use it when you don’t need to do any other operations on the file.
(sheet-ref-rows xlsx-file-path sheet-index)
→ (listof (listof (or/c string? number?))) xlsx-file-path : path-string? sheet-index : exact-nonnegative-integer?