Write CSV from List of HashMaps with Header using Apache Commons CSV
问题 I have to take an ArrayList of HashMap and create a CSV using Apache Commons CSV. However, it's not writing the values to the right headers. Is there an easy way to have the library automatically place the values to the right headers using the Enum? I don't want to manually assign it as I will be adding more columns. This is what it's producing: Here is what I have: Header.java public enum Header { FIRST_NAME(), LAST_NAME(), GENDER(); } Main public static void main(String[] args) { List<Map