Created
January 13, 2016 21:36
-
-
Save damiththa/d9e8d73cfe2e8e2fef66 to your computer and use it in GitHub Desktop.
Creating a csv file in ColdFusion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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