Convert CSV to JSON using Jackson. Use a POJO for conversion or a List & Map for intermediate storage.
“Any fool can know. The point is to understand.”
― Albert Einstein
1. Introduction
CSV to JSON conversion is easy. In this article, we present a couple of methods to parse CSV data and convert it to JSON. The first method defines a POJO and uses simple string splitting to convert CSV data to POJO, which in turn is serialized to JSON. The second method uses a more complete CSV parser with support for quoted fields and commas embedded within fields. In this method, we use the Java Collection classes to store the parsed data and convert those to JSON.
Continue reading “How to Convert CSV to JSON in Java”