Hi, I am new to awk and unix programming and trying to manipulate a csv file.
My current csv file looks like this:
col1,col2,col3,col4,col5,col4,col5,col6,col7,col8
223,V,c,2,4,f,r,,y,z
223,V,c,3,2,f,r,,y,z
223,V,c,1,4,f,r,,y,z
223,V,c,4,3,f,r,,y,z
227,V,c,3,1,f,r,,y,z
227,V,c,4,1,f,r,,y,z
228,V,c,5,5,f,r,,y,z
228,V,c,2,4,f,r,,y,z
228,V,c,1,7,f,r,,y,z
228,V,c,1,8,f,r,,y,z
228,V,c,1,1,f,r,,y,z
228,V,c,1,4,f,r,,y,z
228,V,c,1,5,f,r,,y,z
Desired output csv:
col1,Sum of col4,Sum of col5
223,10,13
227,7,2
228,12,34
I tried a bunch of awk
commands but nothing seemed to work
Is there any awk
solution for this?
Thank you in advance.