Thanks! I did implement your suggestions and did get what I wanted as a result. Now when I try to convert this to a csv file I get the following error. It doesn't make sense to me though considering both rows 1 and 2 have three columns each?