Well, here's the code I'm trying, but I get nothing on the
screen... no errors, no output, either...

Suggestions, anyone?

Rick


<cfset filepath = 
"e:\inetpub\webroot\real_estate_data\hmls\data\#DateFormat(now(),
'yyyy_mmdd')#_idx_custom\office.txt">

<cffile action = "read" file = "#filepath#" variable = "hmls_offices">

<cfset firstline = true>

<cfloop index = "record" list = "hmls_offices" delimiters = "#chr(13)#, 
#chr(10)#">

<cfif firstline is false>

        <cfset office_id = listgetat(record, 1, "#chr(9)#")>
        <cfset office_name = listgetat(record, 2, "#chr(9)#")>
        <cfset street_no_street_name = listgetat(record, 3, "#chr(9)#")>
        <cfset address_02 = listgetat(record, 4, "#chr(9)#")>
        <cfset city = listgetat(record, 5, "#chr(9)#")>
        <cfset state = listgetat(record, 6, "#chr(9)#")>
        <cfset zipcode = listgetat(record, 7, "#chr(9)#")>
        <cfset phone = listgetat(record, 8, "#chr(9)#")>
        <cfset fax = listgetat(record, 9, "#chr(9)#")>
        <cfset email = listgetat(record, 10, "#chr(9)#")>
        
        <cfoutput>#record#</cfoutput><br><br>

        <cfoutput>
        
                office_id = #office_id#<br>
                office_name = #office_name#<br>
                street_no_street_name = #street_no_street_name#<br>
                address_02 = #address_02#<br>
                city = #city#<br>
                state = #state#<br>
                zipcode = #zipcode#<br>
                phone = #phone#<br>
                fax = #fax#<br>
                email = #email#<br>
                
        </cfoutput>     
        
<cfelse>

        <cfset firstline = false>
        
</cfif>

</cfloop>

> -----Original Message-----
> From: Rick Faircloth [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 25, 2008 10:59 PM
> To: CF-Talk
> Subject: RE: Trying to read a text file of data and input into db...
> 
> Hi, Dave...
> 
> Yes, it is a tab-delimited file.  I've already been
> manually importing several different documents into MySQL 5
> using Navicat.  I've got the manual approach down pat, but
> need to automate this part.
> 
> I did find this technique written up online from 2003, which
> I'll try to incorporate into the solution.  (And I did try
> using #record# instead of #hmls_offices#, but the entire file
> was output again...)
> 
> <cfset bln_FirstLine = true>
> <cfloop
> list="#str_Content#"
> delimiters="#chr(13)##chr(10)#"
> index="str_Line">
> 
> <!--- Ignore the column name
> line --->
> <cfif bln_FirstLine is false>
> <cfset str_Name =
> listGetAt(str_Line, 1, ",")>
> <cfset str_Phone =
> listGetAt(str_Line, 2, ",")>
> <cfset str_Email =
> listGetAt(str_Line, 3, ",")>
> <cfelse>
> <cfset bln_FirstLine = false>
> </cfif>
> </cfloop>
> 
> 
> 
> > -----Original Message-----
> > From: Dave Francis [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, June 25, 2008 10:02 PM
> > To: CF-Talk
> > Subject: RE: Trying to read a text file of data and input into db...
> >
> > Off the top of my head, shouldn't it be <cfoutput>#record#</cfoutput>?
> > And I know you said tab-delimited, but have you confirmed that it really
> > is? ie what does listlen(list,Chr(09)) give you.
> >
> 
> 
> 
> 

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

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308165
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to