Hi Rob
 
I'd grab the first 100 characters and display their ascii codes just to make sure there is an ascii 10 separating each line.
One other gotcha is make sure any empty fields are separated by spaces, as ,,,, returns 1 or 0 list elements, rather than the 5 or 6 I would normally expect..
 
HTH
Aaron
 
----- Original Message -----
From: rob
Sent: Friday, April 30, 2004 7:56 AM
Subject: [cfaussie] importing a csv file into mysql



i found this which is exactly what i want to do

http://www.defusion.com/articles/index.cfm?ArticleID=206


I have got it to work however it is having trouble counting the amount of arrays

this is the code that is being a pain....

<!--- Set the Record Count --->                
<cfset end_of_line = Chr(10)>
<cfset filepath = #getDirectoryFromPath(getbasetemplatepath())#>
<cffile action="" file="#filepath#calendar.csv" variable="DataFile">
                
<!--- Remove all single quotes --->                
<cfset clean_data_file = Replace(DataFile, "'", " ")>

<!--- Put the list into an Array --->
<cfset data_line_array = ListToArray(clean_data_file, end_of_line)>

<!--- Count the number of Arrays --->
<cfset arraycount = #ArrayLen(data_line_array)#>
<cfoutput>#arraycount#</cfoutput>


my file has over 1200 records however it is only when i run this i only get one.....

big problem!!!

thanks people

Rob.



Robert Shaw
Online Learning
[EMAIL PROTECTED]
MLC School
Rowley Street
Burwood 2134
Phone: 97471266
Mobile: 0422222515
Fax: 97453254
Robert Shaw
Online Learning
[EMAIL PROTECTED]
MLC School
Rowley Street
Burwood 2134
Phone: 97471266
Mobile: 0422222515
Fax: 97453254
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to