Have a look at this:
Converting comma separated data in a column to rows for selection[
^] It doesn't do exactly what you want, but it should give you some ideas.
If it doesn't, you are going to have to give us a lot more info - including samp
le input and output data, along with a better idea of exactly what you tried and why it didn't work.