I have used the <file:writeFile> tags to do a delimited file output in the past and it worked well. this is an example of a || delimited file.
you do a standard select query and then cycle through the results. This output puts a header row on the text file, then displays the results.
<file:writeFile fileName="D:\Share\Survey\file${gel_objectInstanceId}.txt" delimiter="||" embedded="false">
<file:comment value="Project ID || First Name || Last Name || ..... || Additional Comments"/>
<core:forEach items="${results.rowsByIndex}" var="row">
<core:forEach var="columnName" items="${results.columnNames}" indexVar="i" step ="37">
<file:line>
<file:column value="${row[0]}"/>
<file:column value="${row[1]}"/>
<file:column value="${row[2]}"/>
<file:column value="${row[3]}"/>
.
.
.
.
<file:column value="${row[36]}"/>
</file:line>
</core:forEach>
</core:forEach>
</file:writeFile>