From: WebDev on 27 Aug 2007 13:35 I am attempting to loop trough a txt file and loop the entries into a database. The file is delimited by a pipe '|' but when I attempt it, I get: Incorrect number of columns in row. Verify the number of columns specified in the columns attribute and in the target file The error occurred in wwwroot\test.cfm Line 3 Line 3 being the cfhttpparam type="Header" name="TE", but if I remove it, I get an error in the main CFHTTP line (1). After googling for a while I found a site that mentions that if the file has a carriage return, you can get this error. Is there a way to remove the carriage return or am I missing something else. Below is my code for the CFHTTP. <cfhttp name="Property" url="http://www.bpoprosonline.com/assets/property/idxrs082607.txt" delimiter="|" method="get"> <cfhttpparam type="Header" name="Accept-Encoding" value="deflate;q=0"> <cfhttpparam type="Header" name="TE" value="deflate;q=0"> </cfhttp> If you want to see the file, you can use the URL link above to link to my sample txt file. Thanks. -- Wally Kolcz MyNextPet.org Founder / Developer 586.871.4126
From: ALAKAN on 27 Aug 2007 14:45 Wally, I faced a similar problem while reading a text file using Python language it has something with the encoding format.Once I changed to "utf-8" character mode to read the file it was solved. Try reading the file in utf-8 format or set the mimetype to text/html using the cfhttpparam. I exactly don't know how to do using CFML but its certainly some problem with encoding of file. Thx AL
From: WebDev on 27 Aug 2007 16:56 I also tried this and got the same error: <cfhttpparam type="FILE" name="idxrs082607.txt" file="E:\webs\bpoprosonline.com\assets\property" mimetype="text/html"/>
From: WebDev on 27 Aug 2007 16:51 Does anyone know how to do that. I have been trying now for about 20 minutes and I keep getting errors. I tried: <cfhttpparam type="FILE" name="file" file="E:\webs\bpoprosonline.com\assets\property\idxrs082607.txt" mimetype="text/html"/> But I get that the file specified cannot be found, even though I have tested it many times.
From: WebDev on 27 Aug 2007 17:07
I figured out my own stupidity on that one, but when I added the cfhttpparam and pointed it to the file, I then got the error: Incorrect number of columns in row. Verify the number of columns specified in the columns attribute and in the target file How can I get CF to ignore the other columns and only show use the ones I want or can't it? |