>does the original data need to be a 2 dimensional array or can you generate >it as q uery, then you only have 1 loop.
It actually is a query - however the query contains fields that aren't necessarily going to be in the output file. There wouldn't necessarily have to be an inside loop but the alternative would be something like <cfif arrayFind(fieldsArray,'MYCOL1')> .. output MYCOL1 ...</cfif> ... <cfif arrayFind(fieldsArray,'MYCOL180')> .. output MYCOL180 ...</cfif> And I don't think that would be very efficient. -- For what it's worth, Looping over the fields array: <cfloop array="#fieldsArray#" index="local.field"> <cfset fileOutput.write( resultSet[local.field][resultSet.currentRow].toString() )> </cfloop> was 3 seconds slower than the original code on a query of 6000 rows and outputting all 180 columns. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346830 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

