12

I want to write a program that compares two Microsoft Excel sheets using Java.

Is there any existing library (and its documentation) that can help me get started with basic stuffs like reading all the rows and columns of the excel ?

Martin Seeler
  • 6,874
  • 3
  • 33
  • 45
OneMoreError
  • 7,518
  • 20
  • 73
  • 112
  • Just want to add [GemBox.Spreadsheet for Java](https://www.gemboxsoftware.com/spreadsheet-java) into the mix, I find its API to be rather easy and straightforward, for instance see the [reading example](https://www.gemboxsoftware.com/spreadsheet-java/examples/open-read-excel-file-in-java/401). – bellpatricia Apr 15 '19 at 13:43
  • Try Aspose.Cells (https://products.aspose.com/cells/java) component that enables Java Applications to create and manage Excel spreadsheets without requiring Microsoft Excel. See the simple example in the document (https://docs.aspose.com/cells/java/add-and-retrieve-data/#retrieving-data-from-cells) on retrieving data. PS. I am working as Support developer/ Evangelist at Aspose. – Amjad Sahi Sep 02 '20 at 19:16

2 Answers2

23

Have a look at Apache POI, which is a Java API for Microsoft Documents.

And here is a tutorial on how to setup and get started with Excel files.

Martin Seeler
  • 6,874
  • 3
  • 33
  • 45
6

1. Apache POI

Apache POI, a project run by the Apache Software Foundation, and previously a sub-project of the Jakarta Project, provides pure Java libraries for reading and writing files in Microsoft Office formats, such as Word, PowerPoint and Excel.

http://poi.apache.org/

2. docx4j

docx4j is a Java library for creating and manipulating Microsoft Open XML (Word docx, Powerpoint pptx, and Excel xlsx) files.

http://www.docx4java.org/trac/docx4j