z_xlsx_parser (zotonic_core v1.0.0-rc.17)
Parse a XLSX spreadsheet file. As unpacking unchecked zip files can consume lots of memory, it is desirable to run this in a separate process and limit the amount of memory that can be used with: erlang:process_flag(max_heap_size, ...).
Summary
Functions
Parse a XLSX file with safety on the maximum amount of memory used. The parsing is done in a separate process. Same as parse_file/2 with no options.
Parse a XLSX file with safety on the maximum amount of memory used. The parsing is done in a separate process. Per default the memory used is limited to 160MB.
Functions
-spec parse_file(file:filename_all()) -> {ok, Rows} | {error, term()} when Rows :: [Row], Row :: [Cell], Cell :: binary() | integer() | float() | undefined.
Parse a XLSX file with safety on the maximum amount of memory used. The parsing is done in a separate process. Same as parse_file/2 with no options.
-spec parse_file(Filename, Options) -> {ok, Rows} | {error, term()} when Filename :: file:filename_all(), Options :: [{max_memory, non_neg_integer()}], Rows :: [Row], Row :: [Cell], Cell :: binary() | integer() | float() | undefined.
Parse a XLSX file with safety on the maximum amount of memory used. The parsing is done in a separate process. Per default the memory used is limited to 160MB.