In the Template Editor dialog, check the 'Remove Newline' parameter. The Current object below implements the standard ADO.NET IDataReader interface.
12345678910111213141516171819202122232425262728#macro( main $reader )
#set( $schemaCols = $reader.Current.GetSchemaTable().Rows )
## Setup header.
#set( $comma = false )
#foreach($col in $schemaCols)
#if( $comma )
,
#else
#set( $comma = true )
#end
$col.ColumnName
#end
#newline()
## Setup data.
#foreach($row in $reader)
#set( $comma = false )
#foreach($col in $schemaCols)
#if( $comma )
,
#else
#set( $comma = true )
#end
$row.get_Item($col.ColumnName)
#end
#newline()
#end
#end
#main( $reader )