I have the table like this
a b c
e x x x
f x x
g x


The column headers are the group and rows are the items that would fall in certain groups. I now want to make a data go like this:

a e
a f
b e
b g
c e
c f

How can I have the data sorted out like this. I have 2000 rows and 80 columns so filter wont help me out much :-( please help