Hi all,
I am creating a comma delimited file to be imported into excel.
I need the text of the fields to be double quoted.
the following code creates the file by concatenating the values of the form fields submitted by a form
<cfparam default="" name="temp_output" type="string">
<cfloop index="fname" list="#form.fieldnames#" >
<cfset temp_output = temp_output & #evaluate("form." & fname)#&",">
</cfloop>
<cfoutput>#removechars(temp_output,len(temp_output),1)#</cfoutput>
<cffile file="D:\utilities\testing.xls" action="append" output="#removechars(temp_output,len(temp_output),1)#" >
the following snippet from the previous code is where I have the issue
<cfset temp_output = temp_output & #evaluate("form." & fname)#&",">
I need the output of #evaluate("form." & fname)# to be double quoted
is there a way to escape double quotes?
if so I could do something like this
<cfset temp_output = temp_output & "(escapechar)""&"#evaluate("form." & fname)#&"(escapechar)""&",">
any help would be most appreciated
Chris Sorel
chris@exnihilo.com
Remember, If you continue to do what you have always done,
you will continue to get what you have always gotten.
I am creating a comma delimited file to be imported into excel.
I need the text of the fields to be double quoted.
the following code creates the file by concatenating the values of the form fields submitted by a form
<cfparam default="" name="temp_output" type="string">
<cfloop index="fname" list="#form.fieldnames#" >
<cfset temp_output = temp_output & #evaluate("form." & fname)#&",">
</cfloop>
<cfoutput>#removechars(temp_output,len(temp_output),1)#</cfoutput>
<cffile file="D:\utilities\testing.xls" action="append" output="#removechars(temp_output,len(temp_output),1)#" >
the following snippet from the previous code is where I have the issue
<cfset temp_output = temp_output & #evaluate("form." & fname)#&",">
I need the output of #evaluate("form." & fname)# to be double quoted
is there a way to escape double quotes?
if so I could do something like this
<cfset temp_output = temp_output & "(escapechar)""&"#evaluate("form." & fname)#&"(escapechar)""&",">
any help would be most appreciated
Chris Sorel
chris@exnihilo.com
Remember, If you continue to do what you have always done,
you will continue to get what you have always gotten.