I have scenario where i will receive the header names (for creating text file) from database. The list will be like
DeptId TeacherId StudentId testname testvalue
101 1 501 A 85
101 1 501 B 90
101 1 502 A 80
101 1 502 B 75
101 2 502 A 80
101 2 502 B 84
102 1 503 A 56
102 1 503 B 60
Assuming that the number of test will be same ( A & B) The output should be like
DeptId TeacherId StudentId A B
101 1 501 85 90
101 1 502 80 75
101 2 502 80 84
102 1 503 56 60