cfloop
DB insert here using listrow
cfloop
/cfloop
/cfloop
should do it.
As an aside, nameconflict="OVERWRITE" has no meaning with an action of READ.
Ade
-----Original Message-----
From: Ed Wong [mailto:[EMAIL PROTECTED]
Sent: 13 May 2005 17:54
To: CF-Newbie
Subject: Looping over a variable from CFFILE
I'm having difficulty understanding what happening behind the scenes of the
CFLOOP below. I hope I explain this properly. The code below reads in an
external file then based on the tabs, carriage returns etc. outputs in a
table format. What I want to do is get each tab entry into a variable so I
can shove it into a database but I'm not sure how?
This is what I have so far...
<cffile action="READ"
file="C:\mywork\list.txt"
nameconflict="OVERWRITE"
variable="results">
<cfloop index="listrow" list="#results#" delimiters="#chr(10)#">
<cfloop index="thiscol" list="#listrow#" delimiters="#chr(10)#,#chr(9)#,'
','=',';'">
<td class="dirlinks">
<cfoutput>#thiscol#</cfoutput>
</td>
</cfloop>
</tr>
</cfloop>
This outputs in a table with 5 tabs
entry1 entry2 entry3 entry4 entry5
entry1 entry2 entry3 entry4 entry5
entry1 entry2 entry3 entry4 entry5
entry1 entry2 entry3 entry4 entry5
How can I "grab" each entry and shove it into a variable so I can add it to
a database as the CFLOOP loops through file I read in?
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.10 - Release Date: 13/05/2005
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Flash for programmers - Flash MX Pro
http://www.houseoffusion.com/banners/view.cfm?bannerid=56
Message: http://www.houseoffusion.com/lists.cfm/link=i:15:933
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54