Try treating your file variable as a list...something like:

<cffile... >

<cfloop list="#Candelo#" delimters=",#CHR(13)##CHR(10)##CHR(13)##CHR(10)#">
        ... do whatever you need to do for each line ...
</cfloop>

HTH
Hatton

Seamus Campbell wrote:

> Hi all
> 
> I have a txt file (I cannot change the format) which I want to 
> insert/update into an access database online.
> 
> I've been trying to read the file using CFFILE but cannot parse it properly
> 
> This is the file:
> 
> "SUS","BUTTER","1876334568","Attracting Butterflies to Your Garden","CLYNE 
> DENSEY",23.95,1,"TP","",
> 
> "SUS","CATTLE","0882660667","Family Cow","VAN LOON DIRK",29.95,2,"PB","",
> 
> "SUS","CATTLE","0911311688","Natural Cattle Care ACRES USA ED","COLEBY 
> PAT",49.50,0,"TP","",
> 
> "SUS","COMPOS","0670904678","Australian Self Sufficiency Ha","SMITH 
> KEITH",39.95,0,"TP","1992",
> 
> "SUS","CONIFE","1876473312","Gardening With Conifers","BLOOM 
> ADRIAN",42.90,0,"HB","2001",
> 
> "SUS","COOKIN","0732265517","Best of Jackie French","FRENCH 
> JACKIE",24.95,1,"TP","",
> 
> "SUS","COWSMI","086417120X","Keeping a Cow","WILSON JIM",0,0,"TP","1987",
> 
> 
> I don't know how to get rid of the last comma in each line, and then how to 
> parse with a blank line between each record.
> 
> I've tried this
> <CFFILE action="READ" 
> file="D:\InetPub\wwwroot\_Candelo\database\candeloweb1603.txt" 
> variable="Candelo">
> <!--- Set a variable to hold the ascii values for a line break and a 
> carriage return --->
> <CFSET new_line=Chr(10) & Chr(13)>
> 
> 
> <!--- Loop thru lines of text --->
> <CFLOOP index="i" list="Candelo" delimiters="new_line">
> <cfoutput>#Candelo#</cfoutput><BR>
> </CFLOOP>
> 
> 
> and get this (but repeated three times!)
> "SUS","BUTTER","1876334568","Attracting Butterflies to Your Garden","CLYNE 
> DENSEY",23.95,1,"TP","", "SUS","CATTLE","0882660667","Family Cow","VAN LOON 
> DIRK",29.95,2,"PB","", "SUS","CATTLE","0911311688","Natural Cattle Care 
> ACRES USA ED","COLEBY PAT",49.50,0,"TP","", 
> "SUS","COMPOS","0670904678","Australian Self Sufficiency Ha","SMITH 
> KEITH",39.95,0,"TP","1992", "SUS","CONIFE","1876473312","Gardening With 
> Conifers","BLOOM ADRIAN",42.90,0,"HB","2001", 
> "SUS","COOKIN","0732265517","Best of Jackie French","FRENCH 
> JACKIE",24.95,1,"TP","", "SUS","COWSMI","086417120X","Keeping a 
> Cow","WILSON JIM",0,0,"TP","1987",
> 
> 
> Can anyone give me some clues or help please
> 
> Many thanks
> 
> Seamus
> 
> 
______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to