Help to Create this file format structure
This data comes form the table and exported into the file in this format
File1 Format
weboffercode1,sourcecode1,1,1,1,1,1,1
weboffercode1,sourcecode2,1,1,1,1,1,1
weboffercode1,sourcecode1,1,1,1,1,1,1
weboffercode1,sourcecode3,1,1,1,1,1,1
weboffercode1,sourcecode3,1,1,1,1,1,1
weboffercode2,sourcecode1,1,1,1,1,1,1
weboffercode2,sourcecode1,1,1,1,1,1,1
weboffercode2,sourcecode2,1,1,1,1,1,1
weboffercode3,sourcecode1,1,1,1,1,1,1
weboffercode3,sourcecode2,1,1,1,1,1,1
I have to format this file in the following format as :-
File2 :
sum of the field f3,f4,f5,f6,f7,f8 for same WebOfferCode and Source code combination
weboffercode1,sourcecode1,2,2,2,2,2,2
weboffercode1,sourcecode2,1,1,1,1,1,1
weboffercode1,sourcecode3,2,2,2,2,2,2
sum of fields f3,f4,f5,f6,f7,f8 for same WebOfferCode
TOTAL, weboffercode1,5,5,5,5,5,5
sum of the field f3,f4,f5,f6,f7,f8 for same WebOfferCode and Source code combination
weboffercode2,sourcecode1,2,2,2,2,2,2
weboffercode2,sourcecode2,1,1,1,1,1,1
sum of fields f3,f4,f5,f6,f7,f8 for same WebOfferCode
TOTAL, weboffercode1,3,3,3,3,3,3
sum of the field f3,f4,f5,f6,f7,f8 for same WebOfferCode and Source code combination
weboffercode3,sourcecode1,1,1,1,1,1,1
weboffercode3,sourcecode2,1,1,1,1,1,1
sum of fields f3,f4,f5,f6,f7,f8 for same WebOfferCode
TOTAL, weboffercode2,2,2,2,2,2,2
So that if I save this file2.csv it is in the format of the picture as shown above.Let me know how can I do the operations on File1 to create such file format as File2...Primarily I was to know how to write a script to add the data present in the file column wise.