My script creates a CSV file based on query results.
The relevant part of the script is
</sql:query>
<core:forEach items="${user_query.rowsByIndex}" trim="true" var="row">
<file:line>
<core:forEach indexVar="c" begin="0" end="46" >
<gel:log category="User-defined process" level="info" message="inside file loop " />
<file:column value="${row[c]}"/>
</core:forEach>
</file:line>
</core:forEach>
That works fine most of the time. When the field queried is displayed as a text box and there are line breaks the line break is inserted while there should only be line breaks at the end of each record. That is valid data. How do I prevent the line breaks within the data from breaking the records.
End of records
When I use a script to put the data into an email that does not happen.
<gel:email from="username@mailserver.com"
fromName="Clarity Admin"
to= "martti.kinnunen@xxxx.com"
subject="CSV to email">
<gel:log category="User-defined process" level="INFO" message="Writing column headers " />
<![CDATA[
"INV_ID",
....
<core:forEach items="${user_query.rowsByIndex}" trim="true" var="row">
<core:forEach indexVar="c" begin="0" end="46" >
<core:choose>
<core:when test="${c != 46}">
<![CDATA[ "${row[c]}", ]]>
</core:when>
<core:otherwise>
<![CDATA[ "${row[c]}" ]]>
</core:otherwise>
</core:choose>
</core:forEach>
<![CDATA[ <br> ]]>
<gel:log category="User-defined process" level="info" message="inside file loop " />
</core:forEach>
</gel:email>
How do I eliminate line breaks within the records or create the file from the body of the email