I need to create a CSV file in a specific format. Here is the format.
“ROWHEAD”,2016/09/13 03:24:42 -0700,”A”,”BCDE”,002,
“SECHEAD”,2016/09/12 00:00:00 -0700,2016/09/12 23:59:59 -0700,”BCDE”
“COLHEAD”,”Col A”,”Col B”,”Col C”,”Col D”,”Col E”,”Col F”
“SECBODY”,”val A”,”val B”,”val C”,”val D”,”val E”,”val F”
“SECBODY”,”val A”,”val B”,”val C”,”val D”,”val E”,”val F”
“SECBODY”,”val A”,”val B”,”val C”,”val D”,”val E”,”val F”
“SECBODY”,”val A”,”val B”,”val C”,”val D”,”val E”,”val F”
“SECFOOT”,”XXX”,0,0,0,0,”YY”,0,”ZZ”,0,189
“SECCOUNT”,1
"ROWFOOT”,”XXX”,0,0,0,0,”YY”,0,”ZZ”,0,189
I have tried using the normal file writer ways which couldn't help me achieving this. Also I tried openCSV API for the same which even doesn't help much.
How can I create a CSV file with such header and footer values associated in it?