I need to write a script to convert the below input into desired output. The input is a csv file
Id, sid,value,name 20,2,245,f1 20,2,345,f2 20,3,445,f3
Id,sid,f1,f2,f3 20,2,245,345, 20,3,,,445
The third and fourth columns in each row needs to be converted into columns.
For example since first and second column of first and second row are same, the values of f1 and f2 should be 3rd column of each row and f3 should be null