use <CFFILE> to read the file into a variable.

<cffile action="" file="C:\yourdir\yourfile.txt" variable="YourVar">


Use LEN(trim(yourvar))  to see if the file is empty.


Then use the list functions to break it up into the data elements to be
entered into your database.


use listlen() to determine how many elements  then loop thru the list using
listgetat() to pull out each element and place in a var, then do an insert
query to place each record in your database.


You didn't mention how each record would be separated out.  CR/LN or if you
know that every Nth element would be the start of a new record.


Hope this helps point you in the right direction.

-----Original Message-----
From: Mickael [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 30, 2003 12:38 PM
To: CF-Talk
Subject: Import of Text File

Hello All,

I need to import a tab delimited text file in to an access database.  I know
that this is possible just don't know how to go about it.  One more thing is
that sometimes the file may be empty.  Can someone point me in the right
direction?

Thanks

Mike

  _____  


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to