In relation to my question - List Map data in excel using java, is there a way where I can convert the code to read csv file with same output as a result
This is the sample csv data:
My expected Output would be like this:
Thank you!
In relation to my question - List Map data in excel using java, is there a way where I can convert the code to read csv file with same output as a result
This is the sample csv data:
My expected Output would be like this:
Thank you!
No Map
involved here, just a List
.
You have not explained the semantics. But it appears that you simply need to define a Person
class (or a Person
record in modern Java) with five properties named in first row.
Read your CSV row by row, constructing a Person
object for each row. I suggest using a library to help with the CSV parsing, such as Apache Commons CSV. Add each new Person
object to a List
such as ArrayList
.
Call toString
on your List
to generate output text. If you want a different format, loop the Person
objects in the list to generate your own text of desired format.
All of this has been covered many many times already on Stack Overflow. So search to learn more.