DEV Community

loading...

Java – Convert Excel File to/from JSON (String/File) – using Apache Poi + Jackson

loizenai
Software Engineer - Founder at https://loizenai.com
・1 min read

https://ozenero.com/java-convert-excel-file-to-from-json-string-file-using-apache-poi-jackson

Java – Convert Excel File to/from JSON (String/File) – using Apache Poi + Jackson

In the tutorial, Grokonez shows how to convert Excel File to JSON String or JSON File and vice versa with Java language by examples.

Dependencies

<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml</artifactId>
    <version>3.17</version>
</dependency>
<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
    <version>2.8.5</version>
</dependency>

Excel to JSON

Excel File to JSON String

We do 2 steps:
– Step 1: Read Excel File into Java List Objects
– Step 2: Convert Java List Objects to JSON String

-> Excel File: customers

convert-excel-file-to-from-json-file-string---excel-file

Customer.java:

More at:

https://ozenero.com/java-convert-excel-file-to-from-json-string-file-using-apache-poi-jackson

Java – Convert Excel File to/from JSON (String/File) – using Apache Poi + Jackson

Discussion (0)

Forem Open with the Forem app