How can I create CSV file in Java and set the header data in single columns instead of comma separated? For example:
Column A = Header1
Column B= Header2
Then write data below of each header:
Header1 Header2
Text1 Text2
Any example please? Many Thanks in advance.
Use uniVocity-parsers to write CSV:
It seems you could use TSV instead of CSV to produce easier to visualise columns, separated by tab. In this case just replace the CsvWriterSettings and CsvWriter by TsvWriterSettings and TsvWriter
Disclosure: I am the author of this library. It's open-source and free (Apache V2.0 license).