Just put the space in the output! <cffile ...> wil
write it.
<cfsaveContent variable="exampleOne">
1A3B35
2E3G64
3L4P10
</cfsaveContent>
^
|
note the blank space at the beginning of each line.
<cffile action="write" file="path/to/file.txt"
output="#exampleOne#">
OR
<cfloop query="myQuery">
<cfset record = "
#myQuery.aCol##myQuery.bCol##myQuery.cCol#">
<cfif myQuery.currentRow EQ 1>
<cffile action="write file="path/to/file.txt"
output="#record#">
<!--- create file and first line of data --->
<cfelse>
<cffile action="append" file="path/to/file.txt"
output="#record#">
<!--- add each additional record to existing file --->
</cfif>
</cfloop>
OR
<cfloop query="myQuery">
<cfif myQuery.currentRow EQ 1>
<cffile action="write file="path/to/file.txt"
output=" #myQuery.aCol##myQuery.bCol##myQuery.cCol#">
<!--- create file and first line of data --->
<cfelse>
<cffile action="append" file="path/to/file.txt"
output=" #myQuery.aCol##myQuery.bCol##myQuery.cCol#">
<!--- add each additional record to existing file --->
</cfif>
</cfloop>
That is a couple of possible ways to do it, but the important
point is
that <cffile...> is going to write anything and
everything in the
output=""> parameter, including white spaces.