Thanks a bunch Paul, this will make my life so much easier. I'll play
around with this a bit and see what I can see.


Bob 
-----Original Message-----
From: Paul Kukiel [mailto:[email protected]] 
Sent: Friday, February 13, 2009 10:58 AM
To: cf-newbie
Subject: RE: looping a text file for an insert?


Hi Bob,

<cfset record = 0 >

<cffile action="read" file="D:\WebNew\temp\EPARank.txt"
attributes="readonly" variable="epafile" />
<cfloop index="line" list="# epafile #" delimiters="#chr(10)##chr(13)#">
    <cfset record = record + 1 />
    <cfif record neq 1 >
       //Do Insert

This will skip the first line.

Paul.

-----Original Message-----
From: Bob Imperial [mailto:[email protected]] 
Sent: Friday, February 13, 2009 10:38 AM
To: cf-newbie
Subject: looping a text file for an insert?


Hi folks,

I'm working on something that's new for me here and need some help. I
have a
tab delimited text file that is sent to me every night and I would like
to
automate the process of inserting the contents into a table I already
have
set up. I've been importing the file manually into and access db then
using
mySQL migration tool to import it into my table. This text file comes to
me
the same way each time with the first row of values being the column
names.
I don't have clue how to set this up other than to use 
<cffile action="read" file="D:\WebNew\temp\EPARank.txt"
attributes="readonly" variable="epafile" /> to read the contents and
I've
played with that and am able to see the contents doing a dump but I have
no
idea how to handle the first row or what the syntax would even look
like.
Any help would be appreciated. TIA!

Bob 





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4362
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to