xlsx_parser v0.0.8 XlsxParser

Summary

Functions

Given a path do an .xlsx and the sheet number (1 based index), this function returns a list of values in the sheet. The values are returned as a list of {column, row, value} tuples. An optional parameter of the zip processing module is allowed (for testing purposes)

Given a path to an .xlsx, this function returns an array of worksheet names

Given a path to an .xlsx, a sheet number, and a path to a csv, this function writes the content of the specified sheet to the specified csv path

Functions

get_sheet_content(path, sheet_number, zip \\ :zip)

Specs

get_sheet_content(String.t, integer, module) ::
  {:ok, XlsxParser.XmlParser.col_row_val} |
  {:error, String.t}

Given a path do an .xlsx and the sheet number (1 based index), this function returns a list of values in the sheet. The values are returned as a list of {column, row, value} tuples. An optional parameter of the zip processing module is allowed (for testing purposes).

get_worksheet_names(path, zip \\ :zip)

Specs

get_worksheet_names(String.t, module) ::
  {:ok, [String.t]} |
  {:error, String.t}

Given a path to an .xlsx, this function returns an array of worksheet names

write_sheet_content_to_csv(xlsx_path, sheet_number, csv_path, zip \\ :zip, file \\ File)

Specs

write_sheet_content_to_csv(String.t, integer, String.t, module, module) ::
  {:ok, String.t} |
  {:error, String.t}

Given a path to an .xlsx, a sheet number, and a path to a csv, this function writes the content of the specified sheet to the specified csv path.