Skip to content
Advertisement

Tag: supercsv

Java – Write hashmap to a csv file

I have a hashmap with a String key and String value. It contains a large number of keys and their respective values. For example: I would like to write this hashmap to a csv file such that my csv file contains rows as below: I tried the following example here using the supercsv library: http://javafascination.blogspot.com/2009/07/csv-write-using-java.html. However, in this example, you

How to isolate an instance of a class with SuperCsv?

Actually I have a class ArticleModele where I store the content of the columns of the .csv, but I don’t know how to access to a particular instance of the class which corresponds to a particular row in the .csv. Here is my code: And here is the class: Answer The code returns with last result, as it overwrites articleModele.

Advertisement