Skip to content

Instantly share code, notes, and snippets.

@damiththa
Created January 13, 2016 21:36
Show Gist options
  • Save damiththa/d9e8d73cfe2e8e2fef66 to your computer and use it in GitHub Desktop.
Save damiththa/d9e8d73cfe2e8e2fef66 to your computer and use it in GitHub Desktop.
Creating a csv file in ColdFusion
<cfset FilePath = "Path\To\The\File">
<cfset FileIs = "FileName.csv">
<cfset FileName = #FilePath#&#FileIs#>
<cffile action="write"
file="#FileName#"
output="Column1,Column2,Column3"
addnewline="yes">
<cfoutput query="qMyQuery">
<cffile action="append"
file="#FileName#"
output="#Col1_value#,#Col2_value#,#Col3_Value#"
addnewline="yes">
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment