I'm a noob in CSV processing using Java.
How can I read/write multiple header CSV in Java. For example:
Data in hand after multiple joins (say from a table).
-------------------------------------------------------------
|student_id | name | year | subject_id | marks| total_marks |
-------------------------------------------------------------
|STD01 | ABC |2001 | SUB01 | 80 | 155 |
|STD01 | ABC |2001 | SUB02 | 75 | 155 |
|STD02 | XYZ |2001 | SUB01 | 85 | 85 |
-------------------------------------------------------------
The above data to be represented in below format in CSV - they differ in the first column which identifies them either as ALL or IND
ALL, STUDENT_ID, NAME, YEAR, TOTAL_MARKS
IND, STUDRNT_ID, NAME, YEAR, SUBJECT_ID, MARKS
ALL, STD01, ABC, 2001, 155
IND, STD01, ABC, 2001, SUB01, 80
IND, STD01, ABC, 2001, SUB02, 75
ALL, STD02, XYZ, 2001, 85
IND, STD02, XYZ, 2001, SUB01, 85
Exporting them as the joined table would mean I have the ALL column in every line which is not desired.
Any clues or useful tools suggestion much appreciated!
I don't now if this will help but maybe this class of mine will help you. It takes a list of objects and returns a CSV file for you. Maybe you can go check out the code in the class just to see what I did https://github.com/ernst223/spread-sheet-exporter