package xlsx2csv

All checked builds pass
  1. Overview
  2. Docs
Simple library to export .xlsx files as CSVs

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.1.2.tar.gz
md5=b5ca6e00caa7369caae5ab5a108afc40
sha512=cdcb84b4d744747c3468493597d8a34996a482ae774cdb3229fc5f1d9663c1f12b6ddc9c5e787cd2536e914dfbd806466e7dc4e874873c5303788e02e3122729

Description

Simple library to export .xlsx files as CSVs

Tags

convert xlsx csv

Added to opam-repository:

README

xlsx2csv

Simple library to export .xlsx files as CSVs

Basic usage

File into a list of strings:

let csvs = Xlsx2csv.convert ~into:`Strings "/path/to/your/excel_file.xlsx" in
match csvs with
| Ok (`Strings lst) ->
    List.iteri
      (fun i r ->
        let d = Format.dprintf "Sheet %d" (i + 1) in
        match r with
        | Ok str -> Format.printf "%t:@.%s@.@." d str
        | Error (`Msg msg) -> Format.printf "ERROR %t:@.%s@.@." d msg)
      lst
| Error (`Msg msg) -> failwith msg
| _ -> assert false

File into more files:

let files =
  Xlsx2csv.convert
    ~enc:(Some `UTF_16)
    ~ignore_hiddens:true
    ~into:(`Files ("/path/to/output/folder", "file_name"))
    "/path/to/your/excel_file.xlsx"
in
match files with
| Ok (`Files lst) ->
    List.iteri
      (fun i r ->
        let d = Format.dprintf "Sheet %d" (i + 1) in
        match r with
        | Ok () -> Format.printf "%t:@.OK@.@." d
        | Error (`Msg msg) -> Format.printf "ERROR %t:@.%s@.@." d msg)
      lst
| Error (`Msg msg) -> failwith msg
| _ -> assert false

Dependencies (7)

  1. fpath
  2. lwt
  3. uutf
  4. xmlm
  5. camlzip
  6. dune >= "3.15"
  7. ocaml >= "4.13"

Dev Dependencies (1)

  1. odoc with-doc

Used by

None

Conflicts

None

Build status

Results of building xlsx2csv with each compiler on check.ci.ocaml.org, run of against opam-repository 7cdc698. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.1.2 (this version) n/a good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure