https://github.com/queryverse/excelreaders.jl
ExcelReaders is a package that provides functionality to read Excel files.
https://github.com/queryverse/excelreaders.jl
data excel julia queryverse
Last synced: about 1 month ago
JSON representation
ExcelReaders is a package that provides functionality to read Excel files.
- Host: GitHub
- URL: https://github.com/queryverse/excelreaders.jl
- Owner: queryverse
- License: other
- Created: 2015-03-12T21:50:49.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-12-29T04:03:45.000Z (over 1 year ago)
- Last Synced: 2024-06-11T20:23:29.416Z (12 months ago)
- Topics: data, excel, julia, queryverse
- Language: Julia
- Homepage:
- Size: 307 KB
- Stars: 58
- Watchers: 4
- Forks: 20
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ExcelReaders
[](https://travis-ci.org/queryverse/ExcelReaders.jl)
[](https://ci.appveyor.com/project/queryverse/excelreaders-jl/branch/master)
[](https://coveralls.io/r/queryverse/ExcelReaders.jl)
[](https://codecov.io/gh/queryverse/ExcelReaders.jl)ExcelReaders is a package that provides functionality to read Excel files.
**WARNING**: Version v0.12 removed support for modern Excel files. This package is now _only_ supporting legacy xls files. The reason for this is that the underlying Python package made that move a couple of years ago as well.
The [XLSX.jl](https://github.com/felipenoris/XLSX.jl) provides excellent support for modern Excel files.
## Installation
Use ``Pkg.add("ExcelReaders")`` in Julia to install ExcelReaders and its dependencies.
The package uses the Python xlrd library. If either Python or the xlrd package are not installed on your Mac or Windows system, the package will use the [Conda.jl](https://github.com/Luthaf/Conda.jl) package to install all necessary dependencies automatically. If you are on another system you can either install Python and xlrd yourself or instruct PyCall to use Conda.jl to manage its own python install (`ENV["PYTHON"]=""; Pkg.build("PyCall")` and restart Julia).
## Alternatives
The [XLSX.jl](https://github.com/felipenoris/XLSX.jl) provides excellent support for modern Excel files.
The [Taro](https://github.com/aviks/Taro.jl) package also provides Excel file reading functionality. The main difference between the two packages (in terms of Excel functionality) is that ExcelReaders uses the Python package [xlrd](https://github.com/python-excel/xlrd) for its processing, whereas Taro uses the Java packages Apache [Tika](http://tika.apache.org/) and Apache [POI](http://poi.apache.org/).
## Basic usage
The most basic usage is this:
````julia
using ExcelReadersdata = readxl("Filename.xls", "Sheet1!A1:C4")
````This will return an array with all the data in the cell range A1 to C4 on Sheet1 in the Excel file Filename.xls.
If you expect to read multiple ranges from the same Excel file you can get much better performance by opening the Excel file only once:
````julia
using ExcelReadersf = openxl("Filename.xls")
data1 = readxl(f, "Sheet1!A1:C4")
data2 = readxl(f, "Sheet2!B4:F10")
````## Reading a whole sheet
The ``readxlsheet`` function reads complete Excel sheets, without a need to specify precise range information. The most basic usage is
````julia
using ExcelReadersdata = readxlsheet("Filename.xls", "Sheet1")
````This will read all content on Sheet1 in the file Filename.xls. Eventual blank rows and columns at the top and left are skipped. ``readxlsheet`` takes a number of optional keyword arguments:
- ``skipstartrows`` accepts either ``:blanks`` (default) or a positive integer. With ``:blank`` any empty initial rows are skipped. An integer skips as many rows as specified.
- ``skipstartcols`` accepts either ``:blanks`` (default) or a positive integer. With ``:blank`` any empty initial columns are skipped. An integer skips as many columns as specified.
- ``nrows`` accepts either ``:all`` (default) or a positive integer. With ``:all``, all rows (except skipped ones) are read. An integer specifies the exact number of rows to be read.
- ``ncols`` accepts either ``:all`` (default) or a postiive integer. With ``:all``, all columns (except skipped ones) are read. An integer specifies the exact number of columns to be read.``readxlsheet`` also accepts an ExcelFile (as obtained from ``openxl``) as its first argument.