I'm stuck with a particular requirement which requires the conversion of dynamic row data to column fields. Suppose I am having a file "output.csv" with the contents like:
TimeStamp,Block,No_of_requests 04:19:12,Block_1,4 04:19:12,Block_2,4 04:19:14,Block_1,3 04:19:15,Block_1,1 04:19:15,Block_2,2 04:19:16,Block_1,5 04:19:16,Block_2,1
What I need the output to look like:
TimeStamp,Block_1,Block_2 04:19:12,4,4 04:19:14,3, 04:19:15,1,2 04:19:16,5,1
The output.csv file is created dynamically using a script, so I don't have a restricted number of blocks (here I have Block_1 & Block_2, but the script can produce many more, eg. Block_3,Block_4,Block_5 and so on)
I need the Block numbers as column headings and the number of requests under each block wrt unique TimeStamp values.
Have been scratching my head around this for quite sometime now, still am nowhere to figuring how to create this pivot.