I am using opencsv-4.0 to write a csv file and I need to add column headers in output file.
Here is my code.
public static void buildPro
I may have missed something obvious here but couldn't you just append your header String to the writer object?
Writer writer = new FileWriter(filePath);
writer.append("header1, header2, header3, ...etc \n");
// This will be followed by your code with BeanToCsvBuilder
// Note: the terminating \n might differ pending env.