Question : coldfusion change csv comma to tab instead

hi all,

i just spent again getting some data ready to be imported into a database and i creted it using commas but now i discover that each field need to be seperated by a tab.

i really dont want to chnage my whole file so can anyone tell me how to chnage the commas below into tabs. thanks

<cffile action="append"
file="E:\Domains\wwwroot\id.txt"
output="#TRIM(Application.id_user_name)#,1265,,,#Left(scndctgry_Name,10)# #Left(product_name,20)# #Left(product_shortdescription,32)#...,#request.websiteURL#images/product_images/#TRIM(Get_Pro_id.prdctImage_FileName)#,new,1,Immediate,10,0,,0,Free,,#TRIM(numberFormat(idrate,'_.__'))#,,11=0.00:,,1|5|10|18,0,#get_pro_id.product_id#,<font face=""Arial"" size=""3"">#TRIM(Get_Pro_id.product_Description)#<ul><li>FREE SHIPPING on all items - Delivered Next Working Day!</li><li>VAT is already included in the price listed @ 17.5% - A VAT invoice will be sent to you.</li><li>All items are brand new and come with Manufactures warranty.</li><li>To buy direct please<a href=""#request.targetdetails#?ProdID=#Get_Pro_id.product_ID#"">click here</a></li></ul></font>,##end##"
addnewline="yes">

Answer : coldfusion change csv comma to tab instead


ListChangeDelims() can change the delimiter, just assign the string to a variable, then change delims and write the variable to the file..


<cfset myString = listChangeDelims(myString,chr(9))>


<cffile action="append"  file="E:\Domains\wwwroot\id.txt"  output="#myString#" .....>
Random Solutions  
 
programming4us programming4us