AFAIK there is no build-in functionality in OpenCSV that will allow to write bean to CSV with custom column names and ordering. Is there a way where I can use both annotations, so that I can create CSV files with column headers and also control column position? If I use = "TradeID") then I am not able to set position of the columns. Position then I am not able to generate column names. The problem with this approach is that if I use = 0) to control StatefulBeanToCsvBuilder(writer).build() īeanToCsv.write(makeFinalMappingBeanList()) Writer writer = new PrintWriter(reportFile) Private String = "MXML GUID", required = 2)Īnd then I use StatefulBeanToCsv class to write into CSV file: File reportFile = new File(reportOutputDir + "/" + REPORT_FILENAME) Private String = "GWML GUID", required = 1) I am using following annotations: public class MappingsBean = 0) Then I write that data into CSV file as report. Next I parse XML files and create a list of mappingbeans. I have created a MappingsBean class where all the columns of the CSV file are specified.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |