Read files in XLSB format in scala

198 Views Asked by At

We are trying to read an XLSB file in scala, but it does not work.

We tried to read the file using

spark.read.excel.load("/path/file.xlsb")

It works with xlsx files but not xlsb files. Do you have a solution ? Is there any function/ command ... that transform xlsb files into xlsx

thank you

1

There are 1 best solutions below

0
Tim Allison On

Try Apache Tika, which handles xlsb. Example of Tika from scala shows how to call Tika via Scala with Tika 1.x.

For Tika 2.x, import the following two dependencies, and you should be good to go with the AutoDetectParser.

<dependency>
  <groupId>org.apache.tika</groupId>
  <artifactId>tika-core</artifactId>
  <version>2.8.0</version>
</dependency>
<dependency>
  <groupId>org.apache.tika</groupId>
  <artifactId>tika-parsers-standard-package</artifactId>
  <version>2.8.0</version>
</dependency>