First of all, please move the thread if this doesn't seem to be the appropriate place for this question, I am posting only because there is Java code involved here.
My Requirement is that I need to programmatically print out a .csv file that has 2 rows as headers. The second row is actually Sub-headers row which has 4-5 sub-headers under each header from first row.
I need to have the headers from Row 1 combined for its sub-headers (like we can in Excel files). I hope the goal is clear.
My questions 1. Is it possible in a .csv file format to combine columns? (I've tried that in advanced text editors like Textpad, Notepad++ and it doesn't seem to work)
2. Is there a Java utility/class/package readily available to implement that?
SCJP 6, next stop - OCPJWCD!
Joined: Feb 21, 2011
Excel works with .csv files pretty well, so you can merge two .csv files by copying and paseting them from one file opened in Excel to another.
Thanks for the reply.
But no, that's not what I am looking for.
For one thing, I need to write a program that will merge them through the PrintWriter that writes the whole file.
And second, the comma separated files (.csv) seem to lose all the column-combining kind of formatting while saving. Otherwise it needs be saved as some other Excel-featured type.
Oops, so rude on my part...
Welcome to Ranch, Fyodor!
You got the requirement right, but you too know how bad it will look.
The requirement is of a Report in CSV which contains 4 pieces of info about 3 departments:
Net Amount I don't think repetition is an option here.