I have the same situation.  What I did is set up an Access DB that uses the
text file as the source of the table.  The text file is copied over
automatically, then I have a simple update page that pulls the info out of
the Access table into SQL.
Hope this helps!!!
CW

-----Original Message-----
From: Larry C. Lyons [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 20, 2001 10:23 AM
To: CF-Talk
Subject: Re: Tag or function to import csv file to db


Peter,

Unfortunately yes. Its a really useful tag for several projects I've
worked on. Fortunately we run WinD'ohs servers here so its not as
critical to us.

The best way I can see ho to do this is to upload the file with cffile
action='upload", then read the file using CFFILE ACTION="Read". You then
loop over the file using chr(10) and chr(13) as your row delimiter and
the comma as your column delimiters.

So in this case, assuming that you've sucessfull uploaded the file and
put it into a variable using CFFile, you would then use a nested CFLoop
to go through each record and update it appropriately.

hth,

larry

Peter Theobald wrote:
> 
> I tried this tag but it is NT only. Not Unix or Linux :-(
> 
> At 11:30 AM 2/16/01 -0500, Larry C. Lyons wrote:
> >Paul,
> >
> >Have a look at Nate Weiss' custom CFX tag called CFX_CSVToQuery. You can
> >get it from his website. Here's the direct URL:
> >http://www.nateweiss.com/taggallery/CFXQueryColumns\CFX_QueryColumns.zip.
> >He also has the documentation on-line for the tag:
> >http://www.nateweiss.com/taggallery/CFX_CSVToQuery\CFX_CSVToQuery.html
> >
> >What I've found is that its somewhat faster than CFFile, and is fairly
> >simple to use.
> >
> >hth,
> >larry
> >
> >--
> >Larry C. Lyons
> >ColdFusion/Web Developer
> >EBStor.com
> >8870 Rixlew Lane, Suite 201
> >Manassas, Virginia 20109-3795
> >tel: (703) 393-7930 x253
> >fax: (703) 393-2659
> >http://www.ebstor.com
> >http://www.pacel.com
> >email: [EMAIL PROTECTED]
> >
> >Chaos, panic, and disorder - my work here is done.
> >--
> >
> >Paul Sinclair wrote:
> >>
> >> I've been trying to figure out a method to suck the contents of a comma
> >> delimited text file into a SQL database on an automated basis. Is there
some
> >> method of doing this via CF? I've looked in the devex for a tag but
don't
> >> see any.
> >>
> >> I'm getting a text file every night from an offsite source and each
morning
> >> I am manually importing the data to the db. I'm sure that CF can do
this via
> >> a cfm template that is run as a scheduled task but I haven't figured
out how
> >> to do it.
> >>
> >> Thanks for any help.
> >>
> >> Paul Sinclair
> >>
> >>
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to