Xlsxir v1.6.4 Xlsxir.XlsxFile View Source
Struct and helper functions to extract and process .xslx files
Example
iex> xlsx_file = Xlsxir.XlsxFile.initialize("./test/test_data/test.xlsx") iex> {:ok, _tid} = Xlsxir.XlsxFile.parse_to_ets(xlsx_file, 0) iex> Xlsxir.XlsxFile.clean(xlsx_file) :ok
Link to this section Summary
Functions
Clean temp ETS tables and extraction folder
Extract and prepare .xlsx file content
Parse all worksheets of the XlsxFile and store their content in ETS tables.
returns [{:ok, worksheet_1_table_id}, ..., {:ok, worksheet_n_table_id}] when timer is false
and [{:ok, worksheet_1_table_id, time1}, ..., {:ok, worksheet_n_table_id, timen}] when timer is true
Parse a worksheet of the XlsxFile and store its content in a ETS table.
returns {:ok, table_id} when timer is false
and {:ok, table_id, time} when timer is true
Parse a worksheet of the XlsxFile as a stream
Link to this section Functions
clean(xlsx_file) View Source
Clean temp ETS tables and extraction folder
initialize(xlsx_filepath, options \\ []) View Source
Extract and prepare .xlsx file content.
Parameters
path- file path of a.xlsxfile type instringformat
Options
:max_rows- the number of rows to fetch from within the worksheet:extract_to- Specify how the.xlsxcontent (i.e. sharedStrings.xml, style.xml and worksheets xml files) will be be extracted before being parsed.:memorywill extract files to memory, and:fileto files in the file system:extract_base_dir- when extracting to file, files will be extracted in a sub directory in the:extract_base_dirdirectory. Defaults toApplication.get_env(:xlsxir, :extract_base_dir)or "temp"
parse_all_to_ets(xlsx_file, timer \\ false) View Source
Parse all worksheets of the XlsxFile and store their content in ETS tables.
returns [{:ok, worksheet_1_table_id}, ..., {:ok, worksheet_n_table_id}] when timer is false
and [{:ok, worksheet_1_table_id, time1}, ..., {:ok, worksheet_n_table_id, timen}] when timer is true
parse_to_ets(xlsx_file, worksheet_index_or_file, timer \\ false) View Source
Parse a worksheet of the XlsxFile and store its content in a ETS table.
returns {:ok, table_id} when timer is false
and {:ok, table_id, time} when timer is true
stream(xlsx_filepath, worksheet_index, options \\ []) View Source
Parse a worksheet of the XlsxFile as a stream