I've been able to get that much working. Here is the situation that I am having problems with:First, I am taking an xml document and putting it into a CSV format. The sections come in the same order in every document. There is the possibility within each document that 1, 2, or all 3 of the sections is missing. If a section is missing, i have to still have the commas in place where they would normally be.Here is an example:The first thing I get from all three sections is a number(that is forced into a 2 digit format). If all three sections are there, it looks like: *stuff before sections*,27,06,13,*stuff after*.Now, if the first section(PS) is missing, it would have to look like *stuff*,,06,13*stuff*.If section 2 is missing, it would look like *stuff*,27,,13,*stuff*If 1 and 3 were missing: *stuff*,,06,,*stuff*