Simple parsing of xlsx spreadsheet data. Data can be retrieved or written to csv.
{:ok, ret} = XlsxParser.get_sheet_content("/path/to/my.xlsx", 1)
ret will contain a list of {column, row, value}:
[{"A", 1, "a"}, {"A", 2, "c"}, {"B", 1, "two"}]
{status, ret} = XlsxParser.write_sheet_content_to_csv("/path/to/my.xlsx", 1, "/path/to/my.csv")
ret will contain the full text written out to /path/to/my.csv
DISCLAIMER:
This parser works on documents I have so far encountered. Please verify that it works for your documents before using in production. Log any issues via github.
This package can be installed by adding xlsx_parser
to your list of dependencies in mix.exs
:
def deps do
[
{:xlsx_parser, "~> 0.1.2"}
]
end